fix handle using asset for access css
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Models\Menu;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
@@ -36,5 +37,20 @@ class AppServiceProvider extends ServiceProvider
|
||||
|
||||
$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');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user