Skip to content

Commit d49e877

Browse files
authored
Fixed a small issue with middlewares merge issue
1 parent 8cd1a6c commit d49e877

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Routing/Route.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,10 @@ protected function mergeControllerProperties()
199199
} elseif (method_exists($controller, 'getMiddlewareForMethod')) {
200200
$controllerMiddleware = $controller->getMiddlewareForMethod($this->controllerMethod);
201201
}
202-
203-
$this->middleware = array_merge($this->middleware, $controllerMiddleware);
202+
203+
if( count($controllerMiddleware) ) {
204+
$this->middleware = array_merge($this->middleware, $controllerMiddleware);
205+
}
204206

205207
if ($property = $this->findControllerPropertyOptions('throttles')) {
206208
$this->throttle = $property['class'];

0 commit comments

Comments
 (0)