Fix: lightbox, profile stats, toast, rating UX

This commit is contained in:
Mark
2026-05-30 01:57:53 +03:00
parent 58e587f955
commit 93d869cf8c
4 changed files with 192 additions and 36 deletions
+16 -6
View File
@@ -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)