35 lines
867 B
PHP
35 lines
867 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class registrasiPasien extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $guarded = ['id'];
|
|
protected $cast = [
|
|
'date_regist' => 'datetime',
|
|
];
|
|
|
|
protected $with = ['patient', 'asuransi', 'roomService', 'pegawai'];
|
|
public function patient(){
|
|
return $this->belongsTo(patient::class, 'pasien_uid', 'uid');
|
|
}
|
|
|
|
public function asuransi(){
|
|
return $this->belongsTo(asuransi::class, 'asuransi_uid', 'uid');
|
|
}
|
|
|
|
public function roomService(){
|
|
return $this->belongsTo(roomService::class, 'ruang_pelayanan_uid', 'uid');
|
|
}
|
|
|
|
public function pegawai(){
|
|
return $this->belongsTo(User::class, 'pegawai_uid', 'uid');
|
|
}
|
|
}
|