Passed
Push — task/user-api-endpoint ( 6e4649...f0b85b )
by Chris
04:32
created

Department::toApiArray()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 10
rs 10
cc 2
nc 2
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 $managers
26
 * @property \Illuminate\Database\Eloquent\Collection $job_posters
27
 *
28
 * Localized Properties:
29
 * @property string $name
30
 * @property string $impact
31
 * @property string $preference
32
 */
33
class Department extends BaseModel
34
{
35
    use CrudTrait;
36
    use HasTranslations;
37
38
    /**
39
     * @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...
40
     * */
41
    public $translatable = [
42
        'name',
43
        'impact',
44
        'preference',
45
    ];
46
47
    /**
48
     * @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...
49
     * */
50
    protected $fillable = [
51
        'name',
52
        'impact',
53
        'preference',
54
    ];
55
56
    public function managers() // phpcs:ignore
57
    {
58
        return $this->hasMany(\App\Models\Manager::class);
59
    }
60
61
    public function job_posters() // phpcs:ignore
62
    {
63
        return $this->hasMany(\App\Models\JobPoster::class);
64
    }
65
}
66