Enable eager loading
This commit is contained in:
@@ -40,13 +40,17 @@ class AirportController extends Controller
|
|||||||
return redirect(route('frontend.dashboard.index'));
|
return redirect(route('frontend.dashboard.index'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$inbound_flights = $this->flightRepo->findWhere([
|
$inbound_flights = $this->flightRepo
|
||||||
'arr_airport_id' => $id,
|
->with(['dpt_airport', 'arr_airport', 'airline'])
|
||||||
])->all();
|
->findWhere([
|
||||||
|
'arr_airport_id' => $id,
|
||||||
|
])->all();
|
||||||
|
|
||||||
$outbound_flights = $this->flightRepo->findWhere([
|
$outbound_flights = $this->flightRepo
|
||||||
'dpt_airport_id' => $id,
|
->with(['dpt_airport', 'arr_airport', 'airline'])
|
||||||
])->all();
|
->findWhere([
|
||||||
|
'dpt_airport_id' => $id,
|
||||||
|
])->all();
|
||||||
|
|
||||||
return view('airports.show', [
|
return view('airports.show', [
|
||||||
'airport' => $airport,
|
'airport' => $airport,
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ class FlightController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$flights = $this->flightRepo
|
$flights = $this->flightRepo
|
||||||
|
->with(['dpt_airport', 'arr_airport', 'airline'])
|
||||||
->orderBy('flight_number', 'asc')
|
->orderBy('flight_number', 'asc')
|
||||||
->orderBy('route_leg', 'asc')
|
->orderBy('route_leg', 'asc')
|
||||||
->paginate();
|
->paginate();
|
||||||
|
|||||||
@@ -32,7 +32,10 @@ class UserController extends Controller
|
|||||||
{
|
{
|
||||||
return view('users.index', [
|
return view('users.index', [
|
||||||
'country' => new \League\ISO3166\ISO3166(),
|
'country' => new \League\ISO3166\ISO3166(),
|
||||||
'users' => $this->userRepo->orderBy('name', 'desc')->paginate(),
|
'users' => $this->userRepo
|
||||||
|
->with(['airline', 'current_airport'])
|
||||||
|
->orderBy('name', 'desc')
|
||||||
|
->paginate(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user