A free open source IT asset/license management system
Fixed visibility for constants and methods
snipec1ae406049be
diff --git a/app/Http/Controllers/ModalController.php b/app/Http/Controllers/ModalController.phpindex 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] [<[email protected]]* @return View*/- function show ($type, $itemId = null) {+ public function show ($type, $itemId = null) {// These values should correspond to a file in resources/views/modals/$allowed_types = [diff --git a/app/Http/Middleware/CheckForTwoFactor.php b/app/Http/Middleware/CheckForTwoFactor.phpindex fd630ef10c..2b72deb8a9 100644--- a/app/Http/Middleware/CheckForTwoFactor.php+++ b/app/Http/Middleware/CheckForTwoFactor.php@@ -11,7 +11,7 @@ class CheckForTwoFactor/*** Routes to ignore for Two Factor Auth*/- const IGNORE_ROUTES = ['two-factor', 'two-factor-enroll', 'setup', 'logout'];+ public const IGNORE_ROUTES = ['two-factor', 'two-factor-enroll', 'setup', 'logout'];/*** Handle an incoming request.diff --git a/app/Models/Asset.php b/app/Models/Asset.phpindex f8e0cab314..68b3845f68 100644--- a/app/Models/Asset.php+++ b/app/Models/Asset.php@@ -34,9 +34,9 @@ class Asset extends Depreciableuse CompanyableTrait;use HasFactory, Loggable, Requestable, Presentable, SoftDeletes, ValidatingTrait, UniqueUndeletedTrait, UniqueSerialTrait;- const LOCATION = 'location';- const ASSET = 'asset';- const USER = 'user';+ public const LOCATION = 'location';+ public const ASSET = 'asset';+ public const USER = 'user';use Acceptable;diff --git a/app/Models/CustomField.php b/app/Models/CustomField.phpindex e0b06318bb..83fa93ec56 100644--- a/app/Models/CustomField.php+++ b/app/Models/CustomField.php@@ -21,7 +21,7 @@ class CustomField extends Model** @var array*/- const PREDEFINED_FORMATS = [+ public const PREDEFINED_FORMATS = ['ANY' => '','CUSTOM REGEX' => '','ALPHA' => 'alpha',diff --git a/app/Models/Setting.php b/app/Models/Setting.phpindex 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 uniquediff --git a/app/Models/User.php b/app/Models/User.phpindex 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, AuthorizableCopublic 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;