From c1ae406049be7e989879612eacb101b87a34d91b Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 6 Feb 2023 12:44:02 -0800 Subject: [PATCH] Fixed visibility for constants and methods Signed-off-by: snipe --- app/Http/Controllers/ModalController.php | 2 +- app/Http/Middleware/CheckForTwoFactor.php | 2 +- app/Models/Asset.php | 6 +++--- app/Models/CustomField.php | 2 +- app/Models/Setting.php | 2 +- app/Models/User.php | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) 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;