public function departures() { $departures = Flight::with('country')->where('scheduled_time', '>', Carbon::now()->subHours(12))->where('codeshare', 0)->where('departure', 1)->orderBy('scheduled_time', 'desc')->get(); return $departures; }
public function flight($flight) { $this_arrival_flight = Flight::with('country')->where('flight_number', $flight)->where('arrival', 1)->first(); $this_departure_flight = Flight::with('country')->where('flight_number', $flight)->where('departure', 1)->first(); return view('pages.flight')->with(['this_arrival_flight' => $this_arrival_flight, 'this_departure_flight' => $this_departure_flight]); }