Passed
Push — task/application-profile-react... ( 903573...bf1a64 )
by
unknown
05:34
created

SkillCategory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 1
eloc 10
c 3
b 0
f 0
dl 0
loc 24
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A skills() 0 3 1
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|null $parent_id - Represents skill category's direct parent (used by Backpack as part of nested set model).
15
 * @property int $lft - Represents skill category's left boundary (used by Backpack as part of nested set model).
16
 * @property int $rgt - Represents skill category's right boundary (used by Backpack as part of nested set model).
17
 * @property int $depth - Represents skill category's nesting depth (used by Backpack as part of nested set model).
18
 * @property \Jenssegers\Date\Date $created_at
19
 * @property \Jenssegers\Date\Date $updated_at
20
 *  @property \Illuminate\Database\Eloquent\Collection $skills
21
 *
22
 */
23
class SkillCategory extends BaseModel
24
{
25
    use CrudTrait;
26
    use HasTranslations;
27
28
    /**
29
     * @var string[]
30
     */
31
    protected $fillable = [
32
        'key',
33
        'name',
34
        'parent_id',
35
    ];
36
37
    /**
38
     * @var string[]
39
     */
40
    public $translatable = [
41
        'name',
42
    ];
43
44
    public function skills() // phpcs:ignore
45
    {
46
        return $this->belongsToMany(\App\Models\Skill::class, 'skill_skill_category');
47
    }
48
}
49