Passed
Push — task/applicant-classification-... ( 9f4daa )
by Yonathan
07:44
created

Classification   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A job_posters() 0 3 1
A skills() 0 3 1
A applicants() 0 6 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 UserRole.
10
 *
11
 * @property int $id
12
 * @property string $key
13
 * @property string $education_requirements
14
 * @property \Jenssegers\Date\Date $created_at
15
 * @property \Jenssegers\Date\Date $updated_at
16
 * @property \Illuminate\Database\Eloquent\Collection $skills
17
 * @property \Illuminate\Database\Eloquent\Collection $job_posters
18
 */
19
class Classification extends BaseModel
20
{
21
    use CrudTrait;
22
    use HasTranslations;
23
24
    /**
25
     * @var string
26
     */
27
    protected $fillable = [
28
        'key',
29
        'education_requirements',
30
    ];
31
32
    public $translatable = [
33
        'education_requirements',
34
    ];
35
36
    public function skills()
37
    {
38
        return $this->belongsToMany(\App\Models\Skill::class)->withTimestamps();
39
    }
40
41
    public function job_posters() //phpcs:ignore
42
    {
43
        return $this->belongsToMany(\App\Models\JobPoster::class);
44
    }
45
46
    public function applicants() //phpcs:ignore
47
    {
48
        return $this->belongsToMany(\App\Models\Applicant::class)
49
        ->withPivot(['level', 'order'])
50
        ->as('gov_classification')
51
        ->withTimestamps();
52
    }
53
}
54