TA/web_JMW/app/Providers/AppServiceProvider.php

32 lines
669 B
PHP

<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\URL;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
if (config('app.env') === 'production' || str_contains(config('app.url'), 'https://')) {
URL::forceScheme('https');
}
if (config('app.url') && str_contains(config('app.url'), 'http')) {
URL::forceRootUrl(config('app.url'));
}
}
}