1 | <?php |
||
10 | class Competitor extends Model |
||
11 | { |
||
12 | use SoftDeletes; |
||
13 | protected $DATES = ['created_at', 'updated_at', 'deleted_at']; |
||
14 | |||
15 | |||
16 | protected $table = 'competitor'; |
||
17 | public $timestamps = true; |
||
18 | protected $fillable = [ |
||
19 | "tournament_category_id", |
||
20 | "user_id", |
||
21 | "confirmed", |
||
22 | ]; |
||
23 | |||
24 | |||
25 | /** |
||
26 | * Get the Competitor's Championship |
||
27 | * @param $ctId |
||
28 | * @return Collection |
||
29 | */ |
||
30 | public function championship($ctId) |
||
39 | |||
40 | /** |
||
41 | * Not sure I use it, I could use $competitor->championship->category |
||
42 | * @param $ctuId |
||
43 | * @return mixed |
||
44 | */ |
||
45 | public function category($ctuId) |
||
52 | |||
53 | |||
54 | /** |
||
55 | * Get the tournament where Competitors is competing |
||
56 | * @param $ctuId |
||
57 | * @return mixed |
||
58 | */ |
||
59 | public function tournament($ctuId) |
||
66 | |||
67 | /** |
||
68 | * Get User from Competitor |
||
69 | * @return mixed |
||
70 | */ |
||
71 | public function user() |
||
75 | |||
76 | |||
77 | public function rounds() |
||
81 | |||
82 | } |
||
83 |