33 lines
710 B
PHP
33 lines
710 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Illuminate\Support\Facades\URL;
|
|
use Illuminate\Http\Request;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
// Reconnaître les headers du reverse proxy
|
|
Request::setTrustedProxies(['*'], Request::HEADER_X_FORWARDED_ALL);
|
|
|
|
// Forcer HTTPS en production et staging (pas en local)
|
|
if (!app()->environment('local')) {
|
|
URL::forceScheme('https');
|
|
}
|
|
}
|
|
}
|