Projects/3BIT/winter-semester/IIS/xnecasr00/app/Providers/AppServiceProvider.php
2026-04-14 19:28:46 +02:00

33 lines
716 B
PHP

<?php
namespace App\Providers;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
// Behind HTTPS-terminating proxies, ensure generated URLs use the public https:// host.
$appUrl = config('app.url');
if (! empty($appUrl)) {
URL::forceRootUrl($appUrl);
if (str_starts_with($appUrl, 'https://')) {
URL::forceScheme('https');
}
}
}
}