java-fpm / app /Providers /AppServiceProvider.php
w
1
560ee81
<?php
namespace App\Providers;
use Illuminate\Routing\UrlGenerator;
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
{
if (env('APP_ENV') == 'production') {
$url->forceScheme('https');
}else{
$url->forceScheme('http');
}
}
}