don't load disabled company #369
This commit is contained in:
@ -204,6 +204,18 @@ class Company extends Eloquent
|
||||
return Auth::user()->companies()->filter($input)->sortable($sort)->paginate($limit);
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope to only include companies of a given enabled value.
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param mixed $value
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeEnabled($query, $value = 1)
|
||||
{
|
||||
return $query->where('enabled', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort by company name
|
||||
*
|
||||
|
Reference in New Issue
Block a user