126 lines
2.3 KiB
PHP
126 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Scopes\SportScope;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Event extends Model
|
|
{
|
|
protected $fillable = [
|
|
'id',
|
|
'provider_id',
|
|
'betsapi_id',
|
|
'betradar_id',
|
|
'bet365_id',
|
|
'_1xbet_id',
|
|
'bwin_id',
|
|
'magnig_id',
|
|
'magken_id',
|
|
'lognig_id',
|
|
'logcol_id',
|
|
'starttime',
|
|
'sport_id',
|
|
'country_id',
|
|
'group_id',
|
|
'competition_group_id',
|
|
'home_id',
|
|
'away_id',
|
|
];
|
|
|
|
protected static function booted(): void
|
|
{
|
|
static::addGlobalScope(new SportScope);
|
|
}
|
|
|
|
public function provider()
|
|
{
|
|
return $this->belongsTo(Provider::class);
|
|
}
|
|
|
|
public function sport()
|
|
{
|
|
return $this->belongsTo(Sport::class);
|
|
}
|
|
|
|
public function country()
|
|
{
|
|
return $this->belongsTo(Country::class)->where('disabled', 0)->where('is_country', 1);
|
|
}
|
|
|
|
public function group()
|
|
{
|
|
return $this->belongsTo(Group::class);
|
|
}
|
|
|
|
public function competition_group()
|
|
{
|
|
return $this->belongsTo(CompetitionGroup::class);
|
|
}
|
|
|
|
public function home()
|
|
{
|
|
return $this->belongsTo(Element::class);
|
|
}
|
|
|
|
public function away()
|
|
{
|
|
return $this->belongsTo(Element::class);
|
|
}
|
|
|
|
public function odds_2way()
|
|
{
|
|
return $this->hasMany(Odds2way::class);
|
|
}
|
|
|
|
public function odds_2way_s1()
|
|
{
|
|
return $this->hasMany(Odds2wayS1::class);
|
|
}
|
|
|
|
public function odds_3way()
|
|
{
|
|
return $this->hasMany(Odds3way::class);
|
|
}
|
|
|
|
public function odds_dc()
|
|
{
|
|
return $this->hasMany(OddsDc::class);
|
|
}
|
|
|
|
public function odds_dnb()
|
|
{
|
|
return $this->hasMany(OddsDnb::class);
|
|
}
|
|
|
|
public function odds_ggng()
|
|
{
|
|
return $this->hasMany(OddsGgng::class);
|
|
}
|
|
|
|
public function odds_handicap()
|
|
{
|
|
return $this->hasMany(OddsHandicap::class);
|
|
}
|
|
|
|
public function odds_handicap_q1()
|
|
{
|
|
return $this->hasMany(OddsHandicapQ1::class);
|
|
}
|
|
|
|
public function odds_total()
|
|
{
|
|
return $this->hasMany(OddsTotal::class);
|
|
}
|
|
|
|
public function odds_total_q1()
|
|
{
|
|
return $this->hasMany(OddsTotalQ1::class);
|
|
}
|
|
|
|
public function odds_tq()
|
|
{
|
|
return $this->hasMany(OddsTq::class);
|
|
}
|
|
}
|