/** * Get a JSON Cinema instance by the specified id * * @return Response */ public function get($id) { // $cinema = Cinemas::find($id); if (!$cinema) { return response()->json(['message' => 'Could not find cinema specified', 'code' => 404], 404); } return response()->json(['data' => $cinema], 200); }
public static function getMessage(Request $request) { $name = User::find($request->input('user_id'))->name; $my_name = $request->user()->name; $seance = Seances::find($request->input('seance')); $movie = Movies::find($seance->movie_id)->title; $cinema = Cinemas::find($seance->cinema_id)->title; $date = $seance->date; $time = $seance->time; $msg = []; $msg[0] = "Привет, " . $name . "! \n\r" . "Приглашаю тебя пойти со мной в кино на фильм \"" . $movie . "\" в кинотеатр " . $cinema . ". \n\r" . "Сеанс, на который предлагаю пойти: " . $date . " в " . $time . ". \n\r" . "Очень надеюсь на твой ответ, \n\r" . $my_name . "."; $msg[1] = "Доброго времени суток, " . $name . "! \n\r" . "Приглашаю Вас посетить кинотеатр " . $cinema . " и посмотреть фильм \"" . $movie . "\".\n\r" . "Сеанс, на который предлагаю пойти: " . $date . " в " . $time . ". \n\r" . "С нетерпением жду Вашего ответа, \n\r" . $my_name . "."; $fixnum = rand(0, 1); $array = array('message' => $msg[$fixnum], 'seance_id' => $request->input('seance')); return response()->json($array); }
public function getCinemaInfo($id) { $cinema = Cinemas::find($id); return view()->make('search.cinema', ['cinema' => $cinema]); }