2023-05-15 10:03:46 +00:00
|
|
|
<?php
|
|
|
|
|
2023-05-20 14:09:49 +00:00
|
|
|
namespace Modules\Cetaklabel\Entities;
|
2023-05-15 10:03:46 +00:00
|
|
|
|
|
|
|
class SubDirectorat extends BaseModel
|
|
|
|
{
|
|
|
|
protected $fillable = [
|
|
|
|
'directorat_id',
|
|
|
|
'kode',
|
|
|
|
'name'
|
|
|
|
];
|
|
|
|
|
|
|
|
public function directorat()
|
|
|
|
{
|
2023-05-15 14:14:52 +00:00
|
|
|
return $this->belongsTo(Directorat::class);
|
2023-05-15 10:03:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function sub_jobs()
|
|
|
|
{
|
2023-05-15 14:14:52 +00:00
|
|
|
return $this->hasMany(SubJob::class);
|
2023-05-15 10:03:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function jobs()
|
|
|
|
{
|
2023-05-15 14:14:52 +00:00
|
|
|
return $this->hasManyThrough(Job::class, SubJob::class);
|
2023-05-15 10:03:46 +00:00
|
|
|
}
|
|
|
|
}
|