| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function register() |
||
| 24 | { |
||
| 25 | |||
| 26 | // Automatically apply the package configuration |
||
| 27 | $this->mergeConfigFrom(__DIR__.'/../config/laravel-domain-redirect.php', 'laravel-domain-redirect'); |
||
| 28 | |||
| 29 | $router = $this->app['router']; |
||
| 30 | |||
| 31 | if (method_exists($router, 'middleware')) { |
||
| 32 | $registerMethod = 'middleware'; |
||
| 33 | } elseif (method_exists($router, 'aliasMiddleware')) { |
||
| 34 | $registerMethod = 'aliasMiddleware'; |
||
| 35 | } else { |
||
| 36 | return; |
||
| 37 | } |
||
| 38 | |||
| 39 | $router->$registerMethod('domainRedirect', \Devfaysal\LaravelDomainRedirect\Middleware\DomainRedirect::class); |
||
| 40 | } |
||
| 41 | } |
||
| 42 |