Files
DatBrowser/app/Providers/AppServiceProvider.php
Matthias Guillitte 1c71b88d15
Some checks failed
Push image to registry / build-image (push) Has been cancelled
Force https only if APP_URL statrs with https
2025-02-08 10:11:14 +01:00

32 lines
619 B
PHP

<?php
namespace App\Providers;
use App\Browser\BrowserJob;
use Illuminate\Routing\UrlGenerator;
use Illuminate\Support\Facades\Vite;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(UrlGenerator $url): void
{
Vite::prefetch(concurrency: 3);
if (str_starts_with(env('APP_URL'), "https://")) {
$url->forceScheme('https');
}
}
}