|
|
|
@ -13,6 +13,7 @@ use App\Models\{ReportActivityMaterial,ProjectToChecklistK3,FolderDocumentProyek
|
|
|
|
|
use Illuminate\Database\Query\Builder; |
|
|
|
|
use Illuminate\Support\Facades\{Artisan,DB}; |
|
|
|
|
use App\Helpers\MasterFunctionsHelper; |
|
|
|
|
use Carbon\Carbon; |
|
|
|
|
|
|
|
|
|
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(); |
|
|
|
|
$data = Project::find($id); |
|
|
|
|
$dateNow = Carbon::now(); |
|
|
|
|
if ($data) { |
|
|
|
|
$this->deleteRelative($id, $company_id); |
|
|
|
|
if ($data->delete()) { |
|
|
|
|
// $this->deleteRelative($id, $company_id); |
|
|
|
|
// if ($data->delete()) { |
|
|
|
|
if ($data->update(['deleted_at' => $dateNow, 'deleted_by_id' => $this->currentId])) { |
|
|
|
|
DB::commit(); |
|
|
|
|
return response()->json(['status' => 'success', 'message' => 'Data deleted!', 'code' => 200], 200); |
|
|
|
|
} else { |
|
|
|
|