32 lines
546 B
PHP
32 lines
546 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class PvpMatchPlayer extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'pvp_match_id',
|
|
'user_id',
|
|
'score',
|
|
];
|
|
|
|
protected $casts = [
|
|
'score' => 'float',
|
|
];
|
|
|
|
public function match()
|
|
{
|
|
return $this->belongsTo(PvpMatch::class, 'pvp_match_id');
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
}
|
|
}
|