Optimise User all_accounts(),all_clients(), added Invoice/Service to search
This commit is contained in:
@@ -219,6 +219,18 @@ class Service extends Model
|
||||
return $query->setEagerLoads([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for a record
|
||||
*
|
||||
* @param $query
|
||||
* @param string $term
|
||||
* @return
|
||||
*/
|
||||
public function scopeSearch($query,string $term)
|
||||
{
|
||||
return $query->where('id','like','%'.$term.'%');
|
||||
}
|
||||
|
||||
/** ATTRIBUTES **/
|
||||
|
||||
/**
|
||||
@@ -326,7 +338,7 @@ class Service extends Model
|
||||
* For ADSL, this would be the phone number,
|
||||
* For Hosting, this would be the domain name, etc
|
||||
*/
|
||||
public function getNameShortAttribute(): string
|
||||
public function getNameShortAttribute()
|
||||
{
|
||||
return $this->model ? $this->type->name : 'NAME UNKNOWN';
|
||||
}
|
||||
|
Reference in New Issue
Block a user