mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-14 11:20:53 +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:
@@ -5,6 +5,7 @@ namespace App\Providers;
|
||||
use App\Support\Setting;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class SettingServiceProvider extends ServiceProvider
|
||||
{
|
||||
@@ -16,7 +17,7 @@ class SettingServiceProvider extends ServiceProvider
|
||||
public function register()
|
||||
{
|
||||
$this->app->scoped(Setting::class, function (Application $app) {
|
||||
return Setting::getInstance();
|
||||
return new Setting();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user