56 lines
1.1 KiB
PHP
56 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Event extends Model
|
|
{
|
|
protected $fillable = [
|
|
'id',
|
|
'provider_id',
|
|
'betsapi_id',
|
|
'betradar_id',
|
|
'bet365_id',
|
|
'_1xbet_id',
|
|
'bwin_id',
|
|
'starttime',
|
|
'sport_id',
|
|
'country_id',
|
|
'group_id',
|
|
'competition_group_id',
|
|
'home_id',
|
|
'away_id',
|
|
];
|
|
|
|
public function sport()
|
|
{
|
|
return $this->belongsTo(Sport::class);
|
|
}
|
|
|
|
public function country()
|
|
{
|
|
return $this->belongsTo(Country::class, 'country_id', 'tx_id');
|
|
}
|
|
|
|
public function group()
|
|
{
|
|
return $this->hasOne(Group::class, 'id', 'group_id');
|
|
}
|
|
|
|
public function competition_group()
|
|
{
|
|
return $this->hasOne(CompetitionGroup::class, 'id', 'competition_group_id');
|
|
}
|
|
|
|
public function home()
|
|
{
|
|
return $this->hasOne(Element::class, 'id', 'home_id');
|
|
}
|
|
|
|
public function away()
|
|
{
|
|
return $this->hasOne(Element::class, 'id', 'away_id');
|
|
}
|
|
}
|