diff --git a/app/Http/Controllers/Api/EvidenciasController.php b/app/Http/Controllers/Api/EvidenciasController.php index 427c46f..cdb99e5 100644 --- a/app/Http/Controllers/Api/EvidenciasController.php +++ b/app/Http/Controllers/Api/EvidenciasController.php @@ -91,7 +91,7 @@ public function update(Request $request) if (Evidencias::where(["id" => $request->id])->exists()) { $evidencia = Evidencias::find($request->id); $plan = plan::find($evidencia->id_plan); - if ($plan->id_user == $id_user->id or $id_user->isAdmin()) { + if ($id_user->isCreadorPlan($plan->id) or $id_user->isAdmin()) { $evidencia->codigo = $request->codigo; $evidencia->denominacion = $request->denominacion; $path = $request->adjunto->store('evidencias'); @@ -122,7 +122,7 @@ public function delete($id) if (Evidencias::where(["id" => $id])->exists()) { $evidencia = Evidencias::find($id); $plan = plan::find($evidencia->id_plan); - if ($plan->id_user == $id_user->id or $id_user->isAdmin()) { + if ($id_user->isCreadorPlan($plan->id) or $id_user->isAdmin()) { $evidencia->delete(); return response([ "status" => 1,