-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc0bfa9
commit 0ba0fe6
Showing
2 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,38 @@ | |
* @package Arcanedev\Localization\Traits | ||
* @author ARCANEDEV <[email protected]> | ||
* | ||
* @deprecated since v1.0.3 | ||
* @property \Illuminate\Foundation\Application app | ||
* @property \Arcanedev\Localization\Routing\Router router | ||
* @property array middlewareGroups | ||
* @property array routeMiddleware | ||
*/ | ||
trait LocalizationKernelTrait | ||
{ | ||
// | ||
/** | ||
* Get the route dispatcher callback. | ||
* | ||
* @return \Closure | ||
*/ | ||
protected function dispatchToRouter() | ||
{ | ||
$this->replaceRouter(); | ||
|
||
return parent::dispatchToRouter(); | ||
} | ||
|
||
/** | ||
* Replace the illuminate router with the localization router. | ||
*/ | ||
protected function replaceRouter() | ||
{ | ||
$this->router = $this->app->make('router'); | ||
|
||
foreach ($this->middlewareGroups as $key => $middleware) { | ||
$this->router->middlewareGroup($key, $middleware); | ||
} | ||
|
||
foreach ($this->routeMiddleware as $key => $middleware) { | ||
$this->router->aliasMiddleware($key, $middleware); | ||
} | ||
} | ||
} |