app->environment('production')) { URL::forceScheme('https'); } if (config('database.default') === 'sqlite') { DB::statement('PRAGMA journal_mode=WAL'); DB::statement('PRAGMA synchronous=NORMAL'); DB::statement('PRAGMA busy_timeout=5000'); DB::statement('PRAGMA foreign_keys=ON'); } try { $companyName = Setting::query()->where('key', 'company_name')->value('value'); $timezone = Setting::query()->where('key', 'timezone')->value('value'); if ($companyName) { config(['app.name' => $companyName]); } if ($timezone) { config(['app.timezone' => $timezone]); date_default_timezone_set($timezone); } } catch (\Throwable) { // During initial migration the settings table can be unavailable. } } }