diff --git a/src/Illuminate/Routing/RouteAction.php b/src/Illuminate/Routing/RouteAction.php index 6c5f7c851bac..c54849d180a9 100644 --- a/src/Illuminate/Routing/RouteAction.php +++ b/src/Illuminate/Routing/RouteAction.php @@ -31,6 +31,10 @@ public static function parse($uri, $action) if (is_callable($action)) { if (is_array($action)) { $action = $action[0].'@'.$action[1]; + return [ + 'uses' => $action, + 'controller' => $action + ]; } return ['uses' => $action]; diff --git a/tests/Routing/RoutingRouteTest.php b/tests/Routing/RoutingRouteTest.php index 635977d93222..02877bd1de5c 100644 --- a/tests/Routing/RoutingRouteTest.php +++ b/tests/Routing/RoutingRouteTest.php @@ -1307,6 +1307,8 @@ public function testControllerRoutingArrayCallable() $this->assertEquals(0, $_SERVER['route.test.controller.middleware.parameters.one']); $this->assertEquals(['foo', 'bar'], $_SERVER['route.test.controller.middleware.parameters.two']); $this->assertFalse(isset($_SERVER['route.test.controller.except.middleware'])); + $action = $router->getRoutes()->getRoutes()[0]->getAction()['controller']; + $this->assertEquals('Illuminate\Tests\Routing\RouteTestControllerStub@index', $action); } public function testCallableControllerRouting()