app->singleton(SettingService::class, fn () => new SettingService()); } public function boot(): void { // Condivide le impostazioni di base con TUTTE le view Blade. // Così nelle view puoi usare $appSettings senza doverta passare // esplicitamente da ogni controller. View::composer('*', function ($view) { /** @var SettingService $settings */ $settings = app(SettingService::class); $view->with('appSettings', [ 'company_name' => $settings->get('company_name'), 'currency_symbol' => $settings->get('currency_symbol'), 'theme_color' => $settings->get('theme_color'), 'support_email' => $settings->get('support_email'), ]); }); } }