/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $res = ["success" => false]; try { LabArea::create(['area' => $request['area'], 'capacidad' => $request['capacidad'], 'salon' => $request['salon'], 'id_laboratorio' => Session::get('id_lab')]); $res["success"] = true; $res["msg"] = "El Area se ha registrado <strong>correctamente!</strong>"; $res["tipo"] = "success"; } catch (Exception $e) { $res["tipo"] = "danger"; $res["msg"] = "Los datos son incorrectos"; } return response()->json($res); // }