31 lines
813 B
PHP
31 lines
813 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
|
|
{
|
|
// On Strato the domain points at the deployment folder and .htaccess forwards to current/public;
|
|
// without a fixed root, some URLs (e.g. /sitemap.xml) would be generated with /current/public.
|
|
if (! $this->app->environment('local', 'testing')) {
|
|
URL::forceRootUrl(config('app.url'));
|
|
URL::forceScheme(parse_url((string) config('app.url'), PHP_URL_SCHEME) ?: 'https');
|
|
}
|
|
}
|
|
}
|