From 6962c2b790b5428699fe5897de840d41090fcd37 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sat, 31 Mar 2018 05:19:49 +0200 Subject: Legacy URL Support --- src/Routing/RoutingServiceProvider.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/Routing/RoutingServiceProvider.php') diff --git a/src/Routing/RoutingServiceProvider.php b/src/Routing/RoutingServiceProvider.php index b7db1383..021840c3 100644 --- a/src/Routing/RoutingServiceProvider.php +++ b/src/Routing/RoutingServiceProvider.php @@ -8,7 +8,14 @@ class RoutingServiceProvider extends ServiceProvider { public function register() { - $urlGenerator = $this->app->make(UrlGenerator::class); + $config = $this->app->get('config'); + $class = UrlGenerator::class; + if (!$config->get('rewrite_urls', true)) { + $class = LegacyUrlGenerator::class; + } + + $urlGenerator = $this->app->make($class); $this->app->instance('routing.urlGenerator', $urlGenerator); + $this->app->bind(UrlGeneratorInterface::class, 'routing.urlGenerator'); } } -- cgit v1.2.3-54-g00ecf