From 1646138389484014f1eb6a5576377c3beedc658f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Robles?= Date: Thu, 20 Oct 2022 19:06:58 +0200 Subject: [PATCH] fix resolveFromRoute when using invokable controller --- src/Http/Concerns/ResolvesFromRouteAction.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Http/Concerns/ResolvesFromRouteAction.php b/src/Http/Concerns/ResolvesFromRouteAction.php index b12046d..7958792 100644 --- a/src/Http/Concerns/ResolvesFromRouteAction.php +++ b/src/Http/Concerns/ResolvesFromRouteAction.php @@ -32,11 +32,15 @@ protected function resolveFromRoute() return; } - [$controller, $method] = explode('@', $routeAction); + $routeAction = explode('@', $routeAction); - $this->resolveAttributesFrom(new ReflectionClass($controller)); + if ($controller = array_shift($routeAction)) { + $this->resolveAttributesFrom(new ReflectionClass($controller)); - $this->resolveAttributesFrom(new ReflectionMethod($controller, $method)); + if ($method = array_shift($routeAction)) { + $this->resolveAttributesFrom(new ReflectionMethod($controller, $method)); + } + } } /**