From 6eb445b99c51f98f9c978b7dff9ce71a223313a3 Mon Sep 17 00:00:00 2001 From: ARCANEDEV Date: Fri, 25 Sep 2015 15:12:58 +0100 Subject: [PATCH] Fixing the HTTP Kernel Middlewares --- src/Traits/LocalizationKernelTrait.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Traits/LocalizationKernelTrait.php b/src/Traits/LocalizationKernelTrait.php index 1096caa..b5deb30 100644 --- a/src/Traits/LocalizationKernelTrait.php +++ b/src/Traits/LocalizationKernelTrait.php @@ -8,6 +8,7 @@ * * @property \Illuminate\Foundation\Application app * @property \Arcanedev\Localization\Routing\Router router + * @property array routeMiddleware */ trait LocalizationKernelTrait { @@ -20,6 +21,10 @@ protected function dispatchToRouter() { $this->router = $this->app['router']; + foreach ($this->routeMiddleware as $name => $middleware) { + $this->router->middleware($name, $middleware); + } + return parent::dispatchToRouter(); } }