public function getGestionarChefs(Request $request) { $notif = Session::get('notif'); $chefs = Chef::all(); return view('admin.gestionar-chefs')->with(compact(['chefs', 'notif'])); }
public function postEliminar(Request $request) { // Permite eliminarde manera lógica un chef $validator = Validator::make($request->all(), ['id' => 'exists:Chefs,id']); if ($validator->fails()) { $data['errors'] = $validator->errors(); return redirect('gestionar/chefs')->with($data); } $usuario = Auth::user(); $chef = Chef::find($request->get('id')); $chef->usuario_id = $usuario->id; $chef->activo = 0; $chef->save(); $data['notif'] = "Chef eliminado de manera logica, correctamente."; return redirect('gestionar/chefs')->with($data); }