From 40ed86bfe0cb80573ee5f3df25e6339b0cd84141 Mon Sep 17 00:00:00 2001 From: tiagom62 Date: Wed, 11 Oct 2017 01:02:47 -0400 Subject: [PATCH 1/2] Sudo isnt available on every distro. (#4194) --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 0202235c35..160c8c2ee1 100755 --- a/install.sh +++ b/install.sh @@ -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 \ No newline at end of file From bed7b29417f8b28380ff1b7beb4665433faffc0f Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 10 Oct 2017 22:59:32 -0700 Subject: [PATCH 2/2] Fixes group search --- app/Models/Group.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/Models/Group.php b/app/Models/Group.php index 1446d327e8..1938d6b965 100755 --- a/app/Models/Group.php +++ b/app/Models/Group.php @@ -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.'%'); + }); + } }