public static function getRoomsGreaterThanCapacity($cap) { $mincap = RoomInfo::where('capacity', '>=', $cap)->min('capacity'); // dd($mincap); if (!$mincap) { $lsofrooms = ["msg" => "No rooms of this capacity available"]; } else { $lsofrooms = RoomInfo::whereIn('capacity', [$mincap])->lists('room_no'); } return $lsofrooms; }
/** * Store a newly created resource in storage. * * @param Request $request * @return Response */ public function store(Request $request) { $roomno = $request->get('room_no'); $roomexists = RoomInfo::where('room_no', $roomno)->value('room_no'); if ($roomexists) { $retstatus = 0; } else { $retstatus = RoomInfo::saveFormData($request->except(array('_token'))); } if (is_null($retstatus)) { $msg = "New Room Added"; } else { $msg = "There was some problem with adding this room"; } // dd($msg); // return view('addroom')->with('statusmsg',$msg); return redirect('addroom')->with('statusmsg', $msg); }