Admin platform, with users, transactions, games and admin creation

This commit is contained in:
Edd
2026-01-02 16:17:55 +00:00
parent b9df0a4d4a
commit e89b60c844
14 changed files with 959 additions and 24 deletions
@@ -17,15 +17,12 @@ class GameController extends Controller
$user = Auth::user();
$query = Game::query()->with(["winner", "player1", "player2"]);
// Filter games based on user type
if ($user->type !== 'A') {
// Players can only see games they participate in
$query->where(function ($q) use ($user) {
$q->where('player1_user_id', $user->id)
->orWhere('player2_user_id', $user->id);
});
}
// Admins see all games (no filter needed)
if ($request->has("type") && in_array($request->type, ["3", "9"])) {
$query->where("type", $request->type);