*/ use HasFactory, Notifiable; /** * The attributes that are mass assignable. * * @var list */ protected $connection = 'dbDirectory'; protected $table = 'public.loginuser_s'; public $timestamps = false; protected $primaryKey = "id"; protected $guarded = [ 'id', ]; /** * The attributes that should be hidden for serialization. * * @var list */ protected $hidden = [ 'katasandi' ]; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'katasandi' => 'hashed', ]; } protected $with = ['dataUser', 'masterPersetujuan', 'akses']; public function dataUser(){ return $this->belongsTo(DataUser::class, 'objectpegawaifk', 'id')->select('id', 'namalengkap'); } public function masterPersetujuan(){ return $this->belongsTo(masterPersetujuan::class, 'objectpegawaifk', 'pegawai_id')->where('statusenabled', true)->with('details'); } public function akses(){ return $this->belongsTo(AksesFile::class, 'objectpegawaifk', 'pegawai_id')->where('statusenabled', true); } }