Optimize query with eager loading

This commit is contained in:
Kevin
2018-09-04 20:02:16 +08:00
parent c95fe3c971
commit f7ae027156
7 changed files with 8 additions and 4 deletions

View File

@@ -23,6 +23,7 @@ class LatestPireps extends Widget
$pirepRepo = app(PirepRepository::class);
$pireps = $pirepRepo
->with(['airline', 'aircraft'])
->whereNotInOrder('state', [
PirepState::CANCELLED,
PirepState::DRAFT,