Fix: lightbox, profile stats, toast, rating UX
This commit is contained in:
@@ -16,14 +16,24 @@ class UserController extends Controller
|
||||
'total' => $user->library()->count(),
|
||||
];
|
||||
|
||||
$recentlyPlayed = $user->library()
|
||||
->with('game')
|
||||
->where('status', 'played')
|
||||
->latest('updated_at')
|
||||
->limit(6)
|
||||
$genreStats = \DB::table('genres')
|
||||
->select('genres.id', 'genres.name', \DB::raw('COUNT(*) as count'))
|
||||
->join('game_genre', 'genres.id', '=', 'game_genre.genre_id')
|
||||
->join('user_games', 'game_genre.game_id', '=', 'user_games.game_id')
|
||||
->where('user_games.user_id', $user->id)
|
||||
->whereIn('user_games.status', ['played', 'playing'])
|
||||
->groupBy('genres.id', 'genres.name')
|
||||
->orderByDesc('count')
|
||||
->limit(5)
|
||||
->get();
|
||||
|
||||
return view('users.show', compact('user', 'stats', 'recentlyPlayed'));
|
||||
$allGames = $user->library()
|
||||
->with('game')
|
||||
->latest('updated_at')
|
||||
->limit(12)
|
||||
->get();
|
||||
|
||||
return view('users.show', compact('user', 'stats', 'genreStats', 'allGames'));
|
||||
}
|
||||
|
||||
public function library(User $user)
|
||||
|
||||
Reference in New Issue
Block a user