Passed
Push — feature/hr-admin-panel ( cd39be...90d889 )
by Grant
03:48
created

Department::users()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * Created by Reliese Model.
5
 * Date: Thu, 12 Jul 2018 22:39:27 +0000.
6
 */
7
8
namespace App\Models\Lookup;
9
10
use App\Models\BaseModel;
11
12
use Backpack\CRUD\app\Models\Traits\CrudTrait;
13
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;
14
15
/**
16
 * Class Department
17
 * @property int $id
18
 * @property string $name
19
 * @property string $impact
20
 * @property string $preference
21
 *
22
 * @property \Jenssegers\Date\Date $created_at
23
 * @property \Jenssegers\Date\Date $updated_at
24
 *
25
 * @property \Illuminate\Database\Eloquent\Collection $users
26
 *
27
 * Localized Properties:
28
 * @property string $name
29
 * @property string $impact
30
 * @property string $preference
31
 */
32
class Department extends BaseModel
33
{
34
    use CrudTrait;
35
    use HasTranslations;
36
37
    /**
38
     * @var $translatable string[]
0 ignored issues
show
Documentation Bug introduced by
The doc comment $translatable at position 0 could not be parsed: Unknown type name '$translatable' at position 0 in $translatable.
Loading history...
39
     * */
40
    public $translatable = [
41
        'name',
42
        'impact',
43
        'preference',
44
    ];
45
46
    /**
47
     * @var $fillable string[]
0 ignored issues
show
Documentation Bug introduced by
The doc comment $fillable at position 0 could not be parsed: Unknown type name '$fillable' at position 0 in $fillable.
Loading history...
48
     * */
49
    protected $fillable = [
50
        'name',
51
        'impact',
52
        'preference',
53
    ];
54
55
    public function users() // phpcs:ignore
56
    {
57
        return $this->hasMany(\App\Models\User::class);
58
    }
59
60
    public function job_posters() // phpcs:ignore
61
    {
62
        return $this->hasMany(\App\Models\JobPoster::class);
63
    }
64
}
65