diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 3ebb5f61..e51d0280 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -22,20 +22,8 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { - // Replace HTTP_HOST with site url setted in options to prevent CDN source problems - if (! option('auto_detect_asset_url')) { - $rootUrl = option('site_url'); - - if ($this->app['url']->isValidUrl($rootUrl)) { - $this->app['url']->forceRootUrl($rootUrl); - } - } - - if (option('force_ssl') || Utils::isRequestSecure()) { - $this->app['url']->forceScheme('https'); - } - - View::addExtension('tpl', 'blade'); + // Control the URL generated by url() function + $this->configureUrlGenerator(); Event::listen(Events\RenderingHeader::class, function($event) { // Provide some application information for javascript @@ -72,5 +60,32 @@ class AppServiceProvider extends ServiceProvider if ($this->app->environment() !== 'production') { $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class); } + + // Support *.tpl extension name + View::addExtension('tpl', 'blade'); + } + + /** + * Configure the \Illuminate\Routing\UrlGenerator. + * + * @return void + * + * @codeCoverageIgnore + */ + protected function configureUrlGenerator() + { + if (! option('auto_detect_asset_url')) { + $rootUrl = option('site_url'); + + // Replace HTTP_HOST with site_url set in options, + // to prevent CDN source problems. + if ($this->app['url']->isValidUrl($rootUrl)) { + $this->app['url']->forceRootUrl($rootUrl); + } + } + + if (option('force_ssl') || Utils::isRequestSecure()) { + $this->app['url']->forceSchema('https'); + } } } diff --git a/config/app.php b/config/app.php index 076980bb..dd1d70f1 100644 --- a/config/app.php +++ b/config/app.php @@ -231,7 +231,6 @@ return [ 'Option' => App\Services\Facades\Option::class, 'Utils' => App\Services\Utils::class, 'Minecraft' => App\Services\Minecraft::class, - 'Updater' => App\Services\Updater::class, ], ];