api appointment store and show
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,4 +15,9 @@ class AppointmentParticipant extends Model
|
||||
'participantable_type',
|
||||
'participantable_id',
|
||||
];
|
||||
|
||||
public function participantable()
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,4 +102,9 @@ class Person extends Model
|
||||
{
|
||||
return $this->hasOne(User::class, 'person_id');
|
||||
}
|
||||
|
||||
public function appointmentParticipantables()
|
||||
{
|
||||
return $this->morphMany(AppointmentParticipant::class, 'participantable');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,4 +89,9 @@ class PractitionerRole extends Model
|
||||
{
|
||||
return $this->hasOneThrough(Person::class, Practitioner::class, 'person_id', 'id');
|
||||
}
|
||||
|
||||
public function appointmentParticipantables()
|
||||
{
|
||||
return $this->morphMany(AppointmentParticipant::class, 'participantable');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user