From 54f5bf943725b026692d9b39ee2f7ed65bbd24d2 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Wed, 10 Feb 2021 23:21:49 +0000 Subject: [PATCH] Aligned setting helper with new get method changes Also removed old unsused facade that existed for settings. --- app/Config/app.php | 1 - app/Facades/Setting.php | 16 ---------------- app/Providers/CustomFacadeProvider.php | 5 ----- app/helpers.php | 4 ++-- 4 files changed, 2 insertions(+), 24 deletions(-) delete mode 100644 app/Facades/Setting.php diff --git a/app/Config/app.php b/app/Config/app.php index c97e36e62..ea9738da4 100755 --- a/app/Config/app.php +++ b/app/Config/app.php @@ -183,7 +183,6 @@ return [ // Custom BookStack 'Activity' => BookStack\Facades\Activity::class, - 'Setting' => BookStack\Facades\Setting::class, 'Views' => BookStack\Facades\Views::class, 'Images' => BookStack\Facades\Images::class, 'Permissions' => BookStack\Facades\Permissions::class, diff --git a/app/Facades/Setting.php b/app/Facades/Setting.php deleted file mode 100644 index 80feef89b..000000000 --- a/app/Facades/Setting.php +++ /dev/null @@ -1,16 +0,0 @@ -app->make(ViewService::class); }); - $this->app->singleton('setting', function () { - return $this->app->make(SettingService::class); - }); - $this->app->singleton('images', function () { return $this->app->make(ImageService::class); }); diff --git a/app/helpers.php b/app/helpers.php index c090bfd05..c1d72b91d 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -79,9 +79,9 @@ function userCanOnAny(string $permission, string $entityClass = null): bool /** * Helper to access system settings. - * @return bool|string|SettingService + * @return mixed|SettingService */ -function setting(string $key = null, $default = false) +function setting(string $key = null, $default = null) { $settingService = resolve(SettingService::class);