Add Corporate Specialities
This commit is contained in:
@@ -31,4 +31,19 @@ class CorporateService extends Model
|
||||
{
|
||||
return $this->hasOne(Service::class, 'code', 'service_code');
|
||||
}
|
||||
|
||||
public function specialities()
|
||||
{
|
||||
return $this->hasMany(CorporateServiceSpeciality::class, 'corporate_service_id');
|
||||
}
|
||||
|
||||
public function scopeFilter($query, array $filters)
|
||||
{
|
||||
if (!empty($filters['search'])) {
|
||||
$query->where('service_code', 'LIKE', '%'.$filters['search'].'%')
|
||||
->orWhereHas('service', function($service) use ($filters) {
|
||||
$service->where('name', 'LIKE', '%'.$filters['search'].'%');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user