Skip to content

Commit 0014873

Browse files
committed
Bug fixed RouterCommand beforeAfter method.
1 parent 74f45c3 commit 0014873

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Router/RouterCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ public function beforeAfter($command, $middleware, $path = '', $namespace = '')
7373
return $this->exception($segments[0] . ' middleware file is not found. Please, check file.');
7474

7575
require_once($middlewareFile);
76-
$controller = new $segments[0]();
76+
$middlewareClass = $namespace . $segments[0];
77+
$controller = new $middlewareClass();
7778

7879
if(in_array($segments[1], get_class_methods($controller)))
7980
return call_user_func([$controller, $segments[1]]);

0 commit comments

Comments
 (0)