Skip to content

Commit

Permalink
Merge pull request #79 from ARCANEDEV/fix-kernel_middleware
Browse files Browse the repository at this point in the history
Fixing the kernel's middleware
  • Loading branch information
arcanedev-maroc authored Jan 29, 2017
2 parents 790a658 + 03f76a3 commit da0a0dd
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 da0a0dd

Please sign in to comment.