This commit is contained in:
AfonsoCMSousa
2026-01-02 00:39:39 +00:00
parent bcdf542606
commit e84dd993af
11 changed files with 539 additions and 37 deletions
+11
View File
@@ -29,11 +29,22 @@ class Game extends Model
'match_id'
];
protected $casts = [
'began_at' => 'datetime',
'ended_at' => 'datetime',
'is_draw' => 'boolean',
];
public function winner()
{
return $this->belongsTo(User::class, "winner_user_id");
}
public function loser()
{
return $this->belongsTo(User::class, "loser_user_id");
}
public function player1()
{
return $this->belongsTo(User::class, 'player1_user_id');