api search hospital

This commit is contained in:
Muhammad Fajar
2022-11-03 05:11:57 +07:00
parent ba0023544f
commit d3edc6cb67
9 changed files with 130 additions and 135 deletions

View File

@@ -19,6 +19,17 @@ class PractitionerRole extends Model
'active',
];
/**
* Scope a query to only include active data.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @return void
*/
public function scopeActive($query)
{
$query->where('active', 1);
}
public function getIsChatAvailableAttribute()
{
return $this->practices->where('service_code', 'chat')->where('active', 1)->count() >= 1;