Passed
Push — task/experience-skills ( d76f21 )
by Grant
05:20
created

ExperienceWork::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 App\Models\BaseModel;
6
7
/**
8
 * Class ExperienceWork
9
 *
10
 * @property int $id
11
 * @property string $title
12
 * @property string $organization
13
 * @property string $group
14
 * @property boolean $is_active
15
 * @property \Jenssegers\Date\Date $start_date
16
 * @property \Jenssegers\Date\Date $end_date
17
 * @property int $experienceable_id
18
 * @property string $experienceable_type
19
 * @property \Jenssegers\Date\Date $created_at
20
 * @property \Jenssegers\Date\Date $updated_at
21
 *
22
 * @property \App\Models\Applicant|\App\Models\JobApplication $experienceable
23
 * @property \Illuminate\Database\Eloquent\Collection $skills
24
 */
25
class ExperienceWork extends BaseModel
26
{
27
    protected $casts = [
28
        'title' => 'string',
29
        'organization' => 'string',
30
        'group' => 'string',
31
        'is_active' => 'boolean',
32
        'start_date' => 'date',
33
        'end_date' => 'date'
34
    ];
35
36
    protected $fillable = [
37
        'title',
38
        'organization',
39
        'group',
40
        'is_active',
41
        'start_date',
42
        'end_date'
43
    ];
44
45
    protected $table = ['experiences_work'];
46
47
    public function experienceable() //phpcs:ignore
48
    {
49
        return $this->morphTo();
50
    }
51
52
    public function skills()
53
    {
54
        return $this->morphToMany(\App\Models\Skill::class, 'experience', 'experience_skills');
55
    }
56
}
57