arreglo evidencias 3

This commit is contained in:
Christian Dacid Sullca Puma 2022-10-25 22:20:29 -05:00
parent 33ee3d0225
commit 1d614acb12

View File

@ -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,