Skip to content

Commit

Permalink
Fixing the kernel's middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Jan 29, 2017
1 parent 790a658 commit 03f76a3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Traits/LocalizationKernelTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected function dispatchToRouter()
| ------------------------------------------------------------------------------------------------
*/
/**
* Register middleware groups to router (since Laravel 5.2)
* Register middleware groups to router (since Laravel 5.2).
*/
protected function registerMiddlewareGroups()
{
Expand All @@ -49,12 +49,14 @@ protected function registerMiddlewareGroups()
}

/**
* Register middleware to router
* Register middleware to router.
*/
protected function registerMiddleware()
{
foreach ($this->routeMiddleware as $key => $middleware) {
$this->router->middleware($key, $middleware);
method_exists($this->router, 'aliasMiddleware')
? $this->router->aliasMiddleware($key, $middleware)
: $this->router->middleware($key, $middleware);;
}
}
}

0 comments on commit 03f76a3

Please sign in to comment.