app->singleton('system_settings', function (): ?Setting { try { if (isDBConnected() && Schema::hasTable('settings')) { return Setting::where('type', 'system')->first(); } return null; } catch (\Throwable $th) { return null; } }); $this->app->singleton('intro_page', function (): ?Page { try { if (isDBConnected() && Schema::hasTable('settings')) { $home = Setting::where('type', 'home_page')->first(); $page = Page::where('id', $home->fields['page_id']) ->with(['sections' => function ($query) { $query->orderBy('sort', 'asc'); }]) ->first(); return $page; } return null; } catch (\Throwable $th) { return null; } }); } /** * Bootstrap any application services. */ public function boot(): void { Schema::defaultStringLength(191); // Fix for shared hosting missing CURL_SSLVERSION_TLSv1_2 constant if (!defined('CURL_SSLVERSION_TLSv1_2')) { define('CURL_SSLVERSION_TLSv1_2', 6); // 6 = TLSv1.2 } ResetPassword::createUrlUsing(function (User $user, string $token) { return env('FRONTEND_URL') . '/reset-password?token=' . $token . '&email=' . $user->email; }); // Force HTTPS URLs in non-local envs to avoid mixed-content issues when TLS is terminated // in front of the app container (e.g. Dokploy/Traefik). if (!$this->app->runningInConsole() && !$this->app->environment('local')) { URL::forceScheme('https'); } } }