SyntaxSquad/DADProject#15 feat: Initial Idea
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user