37 lines
730 B
PHP
37 lines
730 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Doctor;
|
|
use App\Models\Patient;
|
|
use App\Models\PatientTreatment;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
class Registration extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = ['patient_id', 'doctor_id', 'registration_date', 'status'];
|
|
|
|
public function patient()
|
|
{
|
|
return $this->belongsTo(Patient::class);
|
|
}
|
|
|
|
public function doctor()
|
|
{
|
|
return $this->belongsTo(Doctor::class);
|
|
}
|
|
|
|
public function patientTreatments()
|
|
{
|
|
return $this->hasMany(PatientTreatment::class);
|
|
}
|
|
|
|
public function payment()
|
|
{
|
|
return $this->hasOne(Payment::class);
|
|
}
|
|
}
|