diff --git a/app/Setting/Actions/ViewAction.php b/app/Setting/Actions/ViewAction.php index 14a88579..459723b6 100644 --- a/app/Setting/Actions/ViewAction.php +++ b/app/Setting/Actions/ViewAction.php @@ -3,6 +3,7 @@ namespace App\Setting\Actions; use App\Setting\LocalSettings; +use App\Setting\SettingFactory; use Inertia\Inertia; use Inertia\Response; use Lorisleiva\Actions\Concerns\AsAction; @@ -16,6 +17,9 @@ class ViewAction session()->put('menu', 'setting'); session()->put('title', $settingGroup::title()); - return Inertia::render('setting/' . ucfirst($settingGroup::group()), $settingGroup->viewData()); + return Inertia::render('setting/' . ucfirst($settingGroup::group()), [ + ...$settingGroup->viewData(), + 'setting_menu' => app(SettingFactory::class)->getShare(), + ]); } } diff --git a/app/Setting/SettingMiddleware.php b/app/Setting/SettingMiddleware.php deleted file mode 100644 index ab854b29..00000000 --- a/app/Setting/SettingMiddleware.php +++ /dev/null @@ -1,26 +0,0 @@ - app(SettingFactory::class)->getShare(), - ]); - - return $next($request); - } -} diff --git a/app/Setting/SettingServiceProvider.php b/app/Setting/SettingServiceProvider.php index 95cb5dec..35c21505 100644 --- a/app/Setting/SettingServiceProvider.php +++ b/app/Setting/SettingServiceProvider.php @@ -23,7 +23,7 @@ class SettingServiceProvider extends ServiceProvider { app()->singleton(SettingFactory::class, fn () => new SettingFactory()); app(Router::class)->bind('settingGroup', fn ($param) => app(SettingFactory::class)->resolveGroupName($param)); - app(Router::class)->middleware(['web', 'auth:web', SettingMiddleware::class])->get('/setting/{settingGroup}', ViewAction::class); + app(Router::class)->middleware(['web', 'auth:web'])->get('/setting/{settingGroup}', ViewAction::class); } /**