| 1 | <?php |
||
| 9 | class Match extends DsManagerOrm |
||
| 10 | { |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | protected $table = 'matches'; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var array |
||
| 19 | */ |
||
| 20 | protected $fillable = [ |
||
| 21 | 'home_team_id', |
||
| 22 | 'away_team_id', |
||
| 23 | 'league_round_id' |
||
| 24 | ]; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var array |
||
| 28 | */ |
||
| 29 | protected $hidden = [ |
||
| 30 | 'home_team_id', |
||
| 31 | 'away_team_id', |
||
| 32 | 'created_at', |
||
| 33 | 'updated_at', |
||
| 34 | 'info' |
||
| 35 | ]; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @var array |
||
| 39 | */ |
||
| 40 | protected $casts = [ |
||
| 41 | 'simulated' => 'boolean' |
||
| 42 | ]; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
| 46 | */ |
||
| 47 | public function homeTeam() |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
| 54 | */ |
||
| 55 | public function awayTeam() |
||
| 59 | |||
| 60 | public function scopeTeams($query) |
||
| 67 | |||
| 68 | public function scopeComplete($query) |
||
| 79 | |||
| 80 | } |