Skip to content

Commit 24113f4

Browse files
committed
use __invoke when no method set for the action
1 parent cd50669 commit 24113f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Illuminate/Routing/Router.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,9 +992,9 @@ protected function getClassClosure($controller)
992992
// Now we can split the controller and method out of the action string so that we
993993
// can call them appropriately on the class. This controller and method are in
994994
// in the Class@method format and we need to explode them out then use them.
995-
[$class, $method] = explode('@', $controller);
995+
$classAndMethod = explode('@', $controller);
996996

997-
return $d->dispatch($route, $request, $class, $method);
997+
return $d->dispatch($route, $request, $classAndMethod[0], $classAndMethod[1] ?? '__invoke');
998998
};
999999
}
10001000

0 commit comments

Comments
 (0)