| Total Complexity | 3 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | class Department extends BaseModel |
||
| 26 | { |
||
| 27 | |||
| 28 | use CrudTrait; |
||
|
|
|||
| 29 | use HasTranslations; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var $fillable string[] |
||
| 33 | */ |
||
| 34 | protected $fillable = [ |
||
| 35 | 'id', |
||
| 36 | 'name', |
||
| 37 | 'impact' |
||
| 38 | ]; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @var $translatable string[] |
||
| 42 | */ |
||
| 43 | public $translatable = [ |
||
| 44 | 'name', |
||
| 45 | 'impact' |
||
| 46 | ]; |
||
| 47 | |||
| 48 | public function managers() // phpcs:ignore |
||
| 49 | { |
||
| 50 | return $this->hasMany(\App\Models\Manager::class); |
||
| 51 | } |
||
| 52 | |||
| 53 | public function job_posters() // phpcs:ignore |
||
| 54 | { |
||
| 55 | return $this->hasMany(\App\Models\JobPoster::class); |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Override the toArray() method to return the localized properties for |
||
| 60 | * name and description. This was causing issues for ajax responses. |
||
| 61 | * |
||
| 62 | * @return mixed[] |
||
| 63 | */ |
||
| 64 | public function toArray() : array |
||
| 70 | } |
||
| 71 | } |
||
| 72 |