1 | <?php |
||
10 | class Competitor extends Model |
||
11 | { |
||
12 | use SoftDeletes; |
||
13 | protected $DATES = ['created_at', 'updated_at', 'deleted_at']; |
||
14 | |||
15 | protected $table = 'competitor'; |
||
16 | public $timestamps = true; |
||
17 | protected $fillable = [ |
||
18 | 'tournament_category_id', |
||
19 | 'user_id', |
||
20 | 'confirmed', |
||
21 | ]; |
||
22 | |||
23 | /** |
||
24 | * Get the Competitor's Championship. |
||
25 | * |
||
26 | * @param $ctId |
||
27 | * |
||
28 | * @return Collection |
||
29 | */ |
||
30 | public function championship($ctId) |
||
39 | |||
40 | /** |
||
41 | * Not sure I use it, I could use $competitor->championship->category. |
||
42 | * |
||
43 | * @param $ctuId |
||
44 | * |
||
45 | * @return mixed |
||
46 | */ |
||
47 | public function category($ctuId) |
||
55 | |||
56 | /** |
||
57 | * Get the tournament where Competitors is competing. |
||
58 | * |
||
59 | * @param $ctuId |
||
60 | * |
||
61 | * @return mixed |
||
62 | */ |
||
63 | public function tournament($ctuId) |
||
71 | |||
72 | /** |
||
73 | * Get User from Competitor. |
||
74 | * |
||
75 | * @return mixed |
||
76 | */ |
||
77 | public function user() |
||
81 | |||
82 | public function fightersGroups() |
||
86 | |||
87 | public function getName() |
||
93 | } |
||
94 |