|
|
@ -13,6 +13,7 @@ use App\Models\{ReportActivityMaterial,ProjectToChecklistK3,FolderDocumentProyek |
|
|
|
use Illuminate\Database\Query\Builder; |
|
|
|
use Illuminate\Database\Query\Builder; |
|
|
|
use Illuminate\Support\Facades\{Artisan,DB}; |
|
|
|
use Illuminate\Support\Facades\{Artisan,DB}; |
|
|
|
use App\Helpers\MasterFunctionsHelper; |
|
|
|
use App\Helpers\MasterFunctionsHelper; |
|
|
|
|
|
|
|
use Carbon\Carbon; |
|
|
|
|
|
|
|
|
|
|
|
const API_GEOLOCATION = "https://nominatim.oslogdev.com/search/ADDR?format=json&addressdetails=1&limit=1"; |
|
|
|
const API_GEOLOCATION = "https://nominatim.oslogdev.com/search/ADDR?format=json&addressdetails=1&limit=1"; |
|
|
|
|
|
|
|
|
|
|
@ -178,9 +179,11 @@ class ProjectController extends Controller |
|
|
|
{ |
|
|
|
{ |
|
|
|
DB::beginTransaction(); |
|
|
|
DB::beginTransaction(); |
|
|
|
$data = Project::find($id); |
|
|
|
$data = Project::find($id); |
|
|
|
|
|
|
|
$dateNow = Carbon::now(); |
|
|
|
if ($data) { |
|
|
|
if ($data) { |
|
|
|
$this->deleteRelative($id, $company_id); |
|
|
|
// $this->deleteRelative($id, $company_id); |
|
|
|
if ($data->delete()) { |
|
|
|
// if ($data->delete()) { |
|
|
|
|
|
|
|
if ($data->update(['deleted_at' => $dateNow, 'deleted_by_id' => $this->currentId])) { |
|
|
|
DB::commit(); |
|
|
|
DB::commit(); |
|
|
|
return response()->json(['status' => 'success', 'message' => 'Data deleted!', 'code' => 200], 200); |
|
|
|
return response()->json(['status' => 'success', 'message' => 'Data deleted!', 'code' => 200], 200); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|