fix handle using asset for access css

This commit is contained in:
2025-06-13 16:10:03 +07:00
parent ac55ed1b67
commit ec8224760e
11 changed files with 44 additions and 24 deletions

View File

@@ -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');
}
}
}
}
}