21 lines
549 B
PHP
21 lines
549 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class UnitKerja extends Model
|
|
{
|
|
protected $connection = 'dbDirectory';
|
|
protected $table = 'public.unitkerjapegawai_m';
|
|
public $timestamps = false;
|
|
protected $primaryKey = 'id';
|
|
protected $guarded = ['id'];
|
|
protected $with = ['subUnitKerja'];
|
|
|
|
public function subUnitKerja(){
|
|
return $this->hasMany(SubUnitKerja::class, 'objectunitkerjapegawaifk', 'id')->where('statusenabled', true)->select('id', 'objectunitkerjapegawaifk', 'name');
|
|
}
|
|
|
|
}
|