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 | 'winner_id', |
||
35 | 'loser_id', |
||
36 | 'is_draw', |
||
37 | ]; |
||
38 | |||
39 | /** |
||
40 | * @var array |
||
41 | */ |
||
42 | protected $casts = [ |
||
43 | 'simulated' => 'boolean' |
||
44 | ]; |
||
45 | |||
46 | /** |
||
47 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
48 | */ |
||
49 | public function homeTeam() |
||
53 | |||
54 | /** |
||
55 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
56 | */ |
||
57 | public function awayTeam() |
||
61 | |||
62 | public function scopeTeams($query) |
||
69 | |||
70 | public function scopeComplete($query) |
||
81 | |||
82 | } |