Skip to content

Commit

Permalink
⚡ reduce query count on dashboard (#2611)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKrisKrisu authored May 27, 2024
1 parent 7c7367f commit 9fdc5a4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/Http/Controllers/Backend/User/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public static function getPrivateDashboard(User $user): Paginator {
return Status::with([
'event', 'likes', 'user.blockedByUsers', 'user.blockedUsers', 'checkin',
'checkin.originStation', 'checkin.destinationStation',
'checkin.originStopover', 'checkin.destinationStopover',
'checkin.Trip.stopovers.station'
])
->join('train_checkins', 'train_checkins.status_id', '=', 'statuses.id')
Expand All @@ -41,6 +42,7 @@ public static function getGlobalDashboard(User $user): Paginator {
return Status::with([
'event', 'likes', 'user.blockedByUsers', 'user.blockedUsers', 'checkin',
'checkin.originStation', 'checkin.destinationStation',
'checkin.originStopover', 'checkin.destinationStopover',
'checkin.Trip.stopovers.station'
])
->join('train_checkins', 'train_checkins.status_id', '=', 'statuses.id')
Expand Down

0 comments on commit 9fdc5a4

Please sign in to comment.