1 | <?php |
||
3 | class Match extends Eloquent |
||
|
|||
4 | { |
||
5 | protected $table = 'matches'; |
||
6 | |||
7 | public function setDateAttribute($date) |
||
8 | { |
||
9 | $this->attributes['date'] = date('Y-m-d', strtotime(str_replace('-', '/', $date))); |
||
10 | } |
||
11 | |||
12 | public function course() |
||
16 | |||
17 | public function season() |
||
21 | |||
22 | public function winners() |
||
26 | |||
27 | public function money() |
||
31 | |||
32 | public function skins() |
||
36 | |||
37 | public function players() |
||
41 | |||
42 | public function playersEdit() |
||
43 | { |
||
44 | return $this->belongsToMany('Player')->withPivot('level_id', 'group', 'handicap', 'winnings')->orderBy('pivot_group', 'asc')->withTimestamps(); |
||
45 | } |
||
46 | |||
47 | public function rounds() |
||
48 | { |
||
49 | return $this->hasMany('Round'); |
||
50 | } |
||
51 | |||
52 | public function holes() |
||
53 | { |
||
54 | return $this->hasManyThrough('Hole', 'Course'); |
||
55 | } |
||
56 | |||
57 | public function getAllMatches() |
||
62 | } |
||
63 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.