Preload fares with PIREP

This commit is contained in:
Nabeel Shahzad 2020-10-13 18:12:14 -04:00
parent bf878a98a4
commit 3b6800077f

View File

@ -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();