Update Doctor Resource
This commit is contained in:
@@ -18,6 +18,26 @@ class PractitionerRole extends Model
|
||||
'period_end',
|
||||
'active',
|
||||
];
|
||||
|
||||
public function getIsChatAvailableAttribute()
|
||||
{
|
||||
return $this->practices->where('service_code', 'chat')->where('active', 1)->count() >= 1;
|
||||
}
|
||||
|
||||
public function getIsWalkinAvailableAttribute()
|
||||
{
|
||||
return $this->practices->where('service_code', 'walkin')->where('active', 1)->count() >= 1;
|
||||
}
|
||||
|
||||
public function getIsVideoAvailableAttribute()
|
||||
{
|
||||
return $this->practices->where('service_code', 'video')->where('active', 1)->count() >= 1;
|
||||
}
|
||||
|
||||
public function getIsInstantChatAvailableAttribute()
|
||||
{
|
||||
return $this->practices->where('service_code', 'instant-chat')->where('active', 1)->count() >= 1;
|
||||
}
|
||||
|
||||
public function metas()
|
||||
{
|
||||
@@ -38,4 +58,14 @@ class PractitionerRole extends Model
|
||||
{
|
||||
return $this->belongsTo(Speciality::class, 'speciality_id');
|
||||
}
|
||||
|
||||
public function practices()
|
||||
{
|
||||
return $this->hasMany(Practice::class, 'practitioner_role_id');
|
||||
}
|
||||
|
||||
public function availabilities()
|
||||
{
|
||||
return $this->hasMany(PractitionerRoleAvailability::class, 'practitioner_role_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user