| Total Complexity | 5 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class Skill extends Model |
||
| 14 | { |
||
| 15 | use CrudTrait; |
||
|
|
|||
| 16 | |||
| 17 | protected $guarded = ['id']; |
||
| 18 | |||
| 19 | protected $with = ['level', 'skill_type']; |
||
| 20 | |||
| 21 | protected $appends = ['complete_name']; |
||
| 22 | |||
| 23 | /** The category the skill belongs to */ |
||
| 24 | public function skill_type() |
||
| 25 | { |
||
| 26 | return $this->belongsTo(SkillType::class); |
||
| 27 | } |
||
| 28 | |||
| 29 | /** A skill belongs to a level, this allows to filter available skills when attaching them to courses */ |
||
| 30 | public function level() |
||
| 31 | { |
||
| 32 | return $this->belongsTo(Level::class); |
||
| 33 | } |
||
| 34 | |||
| 35 | /** A skill is linked to skill evaluations (themselves linked to enrollments) */ |
||
| 36 | public function skill_evaluations() |
||
| 39 | } |
||
| 40 | |||
| 41 | public function presets() |
||
| 44 | } |
||
| 45 | |||
| 46 | public function getCompleteNameAttribute(): string |
||
| 49 | } |
||
| 50 | } |
||
| 51 |