summaryrefslogtreecommitdiff
path: root/src/Routing/RoutingServiceProvider.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-03-31 05:19:49 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-08-05 21:46:05 +0200
commit6962c2b790b5428699fe5897de840d41090fcd37 (patch)
tree646a1dca1db5e801f70733ce6b30d8682241207f /src/Routing/RoutingServiceProvider.php
parent9ca36bed3446cdd4060d7d6fa1025512d0922e0e (diff)
Legacy URL Support
Diffstat (limited to 'src/Routing/RoutingServiceProvider.php')
-rw-r--r--src/Routing/RoutingServiceProvider.php9
1 files changed, 8 insertions, 1 deletions
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');
}
}