added StatisticsController.php and changed the User.php model and ProfileController.php that were missing some imports
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user