added StatisticsController.php and changed the User.php model and ProfileController.php that were missing some imports

This commit is contained in:
2025-12-29 15:34:56 +00:00
parent 329bbcc1d3
commit edecef3af8
3 changed files with 96 additions and 4 deletions
+10
View File
@@ -48,4 +48,14 @@ class User extends Authenticatable
'blocked' => 'boolean',
'deleted_at' => 'datetime',
];
public function wonGames()
{
return $this->hasMany(Game::class, 'winner_user_id');
}
public function games()
{
return $this->hasMany(Game::class, 'player1_user_id')->orWhere('player2_user_id', $this->id);
}
}