Passed
Push — task/skill-skillcategory-relat... ( 4be7cf )
by
unknown
06:50
created

SkillCategory::skills()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Models;
4
5
use Backpack\CRUD\app\Models\Traits\CrudTrait;
6
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;
7
8
/**
9
 * Class SkillCategory
10
 *
11
 * @property int $id
12
 * @property string $key
13
 * @property string $name
14
 * @property int $parent_category_id
15
 * @property \Jenssegers\Date\Date $created_at
16
 * @property \Jenssegers\Date\Date $updated_at
17
 *
18
 */
19
class SkillCategory extends BaseModel
20
{
21
    use CrudTrait;
22
    use HasTranslations;
23
24
    /**
25
     * @var string[]
26
     */
27
    protected $fillable = [
28
        'key',
29
        'name',
30
        'parent_category_id',
31
    ];
32
33
    /**
34
     * @var string[]
35
     */
36
    public $translatable = [
37
        'name',
38
    ];
39
40
    public function skills() // phpcs:ignore
41
    {
42
        return $this->belongsToMany(\App\Models\Skill::class, 'skill_categories_skills');
43
    }
44
}
45