mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-14 19:34:27 +08:00
fix(setting): Resolve admin_setting helper incompatibility with Octane
Updated the `admin_setting` and `admin_settings_batch` helpers to retrieve the `Setting` instance from the service container. This fixes a fatal error and ensures correct behavior in a Laravel Octane environment by preventing the use of stale, shared static instances.
This commit is contained in:
@@ -12,7 +12,7 @@ if (! function_exists('admin_setting')) {
|
||||
*/
|
||||
function admin_setting($key = null, $default = null)
|
||||
{
|
||||
$setting = Setting::getInstance();
|
||||
$setting = app(Setting::class);
|
||||
|
||||
if ($key === null) {
|
||||
return $setting->toArray();
|
||||
@@ -37,6 +37,6 @@ if (! function_exists('admin_settings_batch')) {
|
||||
*/
|
||||
function admin_settings_batch(array $keys): array
|
||||
{
|
||||
return Setting::getInstance()->getBatch($keys);
|
||||
return app(Setting::class)->getBatch($keys);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user