api appointment store and show

This commit is contained in:
Muhammad Fajar
2022-11-07 17:03:39 +07:00
parent d8fbd6b396
commit d742e87285
7 changed files with 191 additions and 1 deletions

View File

@@ -12,7 +12,7 @@ class Appointment extends Model
protected $fillable = [
'status',
'cancelation_reason',
'appointmnet_type',
'appointment_type',
'speciality_id',
'description',
'duration_minutes',
@@ -22,4 +22,19 @@ class Appointment extends Model
'comment',
'patient_instruction'
];
public function appointmentParticipants()
{
return $this->hasMany(AppointmentParticipant::class, 'appointment_id');
}
public function speciality()
{
return $this->belongsTo(Speciality::class, 'speciality_id');
}
public function organization()
{
return $this->belongsTo(Organization::class, 'organization_id');
}
}