44 lines
805 B
PHP
44 lines
805 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Scopes\ClientScope;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Multiline extends Model
|
|
{
|
|
protected $fillable = [
|
|
'client_id',
|
|
'sport_id',
|
|
'bettype_id',
|
|
'matchpart_id',
|
|
'bookmaker_id',
|
|
'sort',
|
|
];
|
|
|
|
public function sport()
|
|
{
|
|
return $this->belongsTo(Sport::class);
|
|
}
|
|
|
|
public function matchpart()
|
|
{
|
|
return $this->belongsTo(Matchpart::class);
|
|
}
|
|
|
|
public function bettype()
|
|
{
|
|
return $this->belongsTo(Bettype::class);
|
|
}
|
|
|
|
public function bookmaker()
|
|
{
|
|
return $this->belongsTo(Bookmaker::class, 'bookmaker_id', 'txid');
|
|
}
|
|
|
|
protected static function booted(): void
|
|
{
|
|
static::addGlobalScope(new ClientScope);
|
|
}
|
|
}
|