applySettingOverrides(); } /** * Overlay database-stored settings (see SettingsRegistry) onto config, * so the rest of the app keeps reading config('mail.from.address') etc. * without knowing whether the value came from .env or the settings UI. * Silently does nothing if the settings table doesn't exist yet (e.g. * during the very first `migrate` on a fresh install). */ protected function applySettingOverrides(): void { try { $overrides = Cache::remember( SettingsRegistry::CACHE_KEY, 300, fn () => Setting::query()->whereNotNull('value')->pluck('value', 'key')->all(), ); } catch (Throwable) { return; } $map = SettingsRegistry::configMap(); foreach ($overrides as $key => $value) { if (isset($map[$key]) && $value !== '') { config([$map[$key] => $value]); } } } /** * Bootstrap any application services. */ public function boot(): void { // } }