From 3b6800077f36a24308f20e8ca2d77510779c7a10 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Tue, 13 Oct 2020 18:12:14 -0400 Subject: [PATCH] Preload fares with PIREP --- app/Http/Controllers/Frontend/PirepController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Frontend/PirepController.php b/app/Http/Controllers/Frontend/PirepController.php index d7cabd98..de3d9243 100644 --- a/app/Http/Controllers/Frontend/PirepController.php +++ b/app/Http/Controllers/Frontend/PirepController.php @@ -181,8 +181,9 @@ class PirepController extends Controller $where = [['user_id', $user->id]]; $where[] = ['state', '<>', PirepState::CANCELLED]; + $with = ['airline', 'aircraft', 'dpt_airport', 'arr_airport', 'fares', 'comments']; - $this->pirepRepo->with(['airline', 'aircraft', 'dpt_airport', 'arr_airport']) + $this->pirepRepo->with($with) ->pushCriteria(new WhereCriteria($request, $where)); $pireps = $this->pirepRepo->orderBy('created_at', 'desc')->paginate();