diff --git a/app/Http/Controllers/ModalController.php b/app/Http/Controllers/ModalController.php index 385877a3ec..6f6b39dd12 100644 --- a/app/Http/Controllers/ModalController.php +++ b/app/Http/Controllers/ModalController.php @@ -17,7 +17,7 @@ class ModalController extends Controller * @author [A. Gianotto] [ '', 'CUSTOM REGEX' => '', 'ALPHA' => 'alpha', diff --git a/app/Models/Setting.php b/app/Models/Setting.php index f2a4184178..8f1f652017 100755 --- a/app/Models/Setting.php +++ b/app/Models/Setting.php @@ -31,7 +31,7 @@ class Setting extends Model * * @var string */ - const SETUP_CHECK_KEY = 'snipeit_setup_check'; + public const SETUP_CHECK_KEY = 'snipeit_setup_check'; /** * Whether the model should inject it's identifier to the unique diff --git a/app/Models/User.php b/app/Models/User.php index 34c0af6b2e..71025eaefe 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -657,7 +657,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo { $query = $query->where('first_name', 'LIKE', '%'.$search.'%') ->orWhere('last_name', 'LIKE', '%'.$search.'%') - ->orWhereRaw('CONCAT('.DB::getTablePrefix().'users.first_name," ",'.DB::getTablePrefix().'users.last_name) LIKE ?', ["%$search%"]); + ->orWhereRaw('CONCAT('.DB::getTablePrefix().'users.first_name," ",'.DB::getTablePrefix().'users.last_name) LIKE ?', ["%{$search}%"]); return $query; } @@ -673,7 +673,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo public function advancedTextSearch(Builder $query, array $terms) { foreach($terms as $term) { - $query = $query->orWhereRaw('CONCAT('.DB::getTablePrefix().'users.first_name," ",'.DB::getTablePrefix().'users.last_name) LIKE ?', ["%$term%"]); + $query = $query->orWhereRaw('CONCAT('.DB::getTablePrefix().'users.first_name," ",'.DB::getTablePrefix().'users.last_name) LIKE ?', ["%{$term}%"]); } return $query;