35 lines
689 B
PHP
35 lines
689 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class TreatmentDetail extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
// Menentukan kolom yang boleh diisi secara massal
|
|
protected $fillable = [
|
|
'treatment_id',
|
|
'medicine_id',
|
|
'dosis',
|
|
'keterangan_pakai',
|
|
];
|
|
|
|
/**
|
|
* Relasi balik ke Header Treatment (Rekam Medis Utama)
|
|
*/
|
|
public function treatment()
|
|
{
|
|
return $this->belongsTo(Treatment::class);
|
|
}
|
|
|
|
/**
|
|
* Relasi ke data Obat (Inventory)
|
|
*/
|
|
public function medicine()
|
|
{
|
|
return $this->belongsTo(Medicine::class);
|
|
}
|
|
} |