arreglo evidencias 2
This commit is contained in:
parent
c421168a77
commit
33ee3d0225
@ -24,9 +24,9 @@ public function create(Request $request)
|
||||
"adjunto" => "required",
|
||||
]);
|
||||
$id_user = auth()->user();
|
||||
if ($id_user->isCreadorPlan($request->id_plan) or $id_user->isAdmin()) {
|
||||
if (plan::where(["id" => $request->id_plan])->exists()) {
|
||||
$plan = plan::find($request->id_plan);
|
||||
if ($plan->id_user == $id_user->id_plan) {
|
||||
if ($id_user->isCreadorPlan($request->id_plan) or $id_user->isAdmin()) {
|
||||
$evidencia = new Evidencias();
|
||||
$evidencia->id_plan = $request->id_plan;
|
||||
$evidencia->codigo = $plan->codigo;
|
||||
@ -34,7 +34,7 @@ public function create(Request $request)
|
||||
error_log($request->denominacion);
|
||||
$path = $request->adjunto->store('evidencias');
|
||||
$evidencia->adjunto = $path;
|
||||
$evidencia->id_user = $id_user->id_plan;
|
||||
$evidencia->id_user = $id_user->id;
|
||||
$evidencia->save();
|
||||
return response([
|
||||
"status" => 1,
|
||||
|
Loading…
Reference in New Issue
Block a user