Merge branch 'develop'

This commit is contained in:
snipe 2017-10-10 22:59:50 -07:00
commit a0d8aa77d3
2 changed files with 18 additions and 1 deletions

View file

@ -36,4 +36,21 @@ class Group extends SnipeModel
{
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.'%');
});
}
}

View file

@ -10,4 +10,4 @@ fi
wget https://raw.githubusercontent.com/snipe/snipe-it/master/snipeit.sh
chmod 744 snipeit.sh
sudo ./snipeit.sh 2>&1 | sudo tee -a /var/log/snipeit-install.log
./snipeit.sh 2>&1 | tee -a /var/log/snipeit-install.log