1 | <?php |
||
7 | class Training extends Model |
||
8 | { |
||
9 | protected $table = 'trainings'; |
||
10 | public $timestamps = true; |
||
11 | |||
12 | protected $fillable = ['name', 'renews_in', 'description', 'administrative', 'training_type_id']; |
||
13 | protected $dates = ['created_at', 'updated_at']; |
||
14 | protected $appends = ['incompleted']; |
||
15 | |||
16 | public function assignedUsers() |
||
20 | |||
21 | public function users() |
||
25 | |||
26 | public function groups() |
||
30 | |||
31 | public function attachments() |
||
35 | |||
36 | public function getIncompletedAttribute() |
||
43 | |||
44 | /** |
||
45 | * @param $query |
||
46 | * @param $input |
||
47 | */ |
||
48 | public function scopeSearchTraining($query, $input) |
||
52 | |||
53 | /** |
||
54 | * Get the training type for the training. |
||
55 | */ |
||
56 | public function trainingType() |
||
60 | |||
61 | /** |
||
62 | * |
||
63 | * @param type $query |
||
64 | * @param type $type |
||
65 | * @return type Training |
||
66 | * |
||
67 | * Get the training for the specified training_type |
||
68 | */ |
||
69 | public function scopeTrainingByType($query, $type) |
||
75 | } |
||
76 |