mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
Fixes group search
This commit is contained in:
parent
40ed86bfe0
commit
bed7b29417
|
@ -36,4 +36,21 @@ class Group extends SnipeModel
|
||||||
{
|
{
|
||||||
return json_decode($this->permissions, true);
|
return json_decode($this->permissions, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query builder scope to search on text
|
||||||
|
*
|
||||||
|
* @param Illuminate\Database\Query\Builder $query Query builder instance
|
||||||
|
* @param text $search Search term
|
||||||
|
*
|
||||||
|
* @return Illuminate\Database\Query\Builder Modified query builder
|
||||||
|
*/
|
||||||
|
public function scopeTextSearch($query, $search)
|
||||||
|
{
|
||||||
|
|
||||||
|
return $query->where(function ($query) use ($search) {
|
||||||
|
|
||||||
|
$query->where('name', 'LIKE', '%'.$search.'%');
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue