Skip to content

Commit e5e809e

Browse files
committed
Fixed bug that regarding to before/after middleware.
1 parent d19e5e8 commit e5e809e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Router/RouterCommand.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@ public function beforeAfter($command, $path = '', $namespace = '')
6363
} elseif (is_string($command)) {
6464
$controller = $this->resolveClass($command, $path, $namespace);
6565
if (method_exists($controller, 'handle')) {
66-
return call_user_func([$controller, 'handle']);
66+
$response = call_user_func([$controller, 'handle']);
67+
if ($response !== true) {
68+
echo $response;
69+
exit;
70+
}
71+
72+
return $response;
6773
}
6874

6975
return $this->exception('handle() method is not found in <b>'.$command.'</b> class.');

0 commit comments

Comments
 (0)