link] = $menu; } $view->with('menus', $menus); }); // Force HTTPS in production if needed if (config('app.env') === 'production') { // Force the application URL to include port if specified $appUrl = config('app.url'); if ($appUrl) { URL::forceRootUrl($appUrl); // Parse URL to check if it's HTTPS $parsedUrl = parse_url($appUrl); if (isset($parsedUrl['scheme']) && $parsedUrl['scheme'] === 'https') { URL::forceScheme('https'); } } } } }