29 lines
454 B
PHP
29 lines
454 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Illuminate\Support\Facades\URL;
|
|
|
|
|
|
class ForceHttpsServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
if (env('NGINX_ENV') === 'prod') {
|
|
URL::forceScheme('https');
|
|
}
|
|
}
|
|
}
|