Skip to content

Commit

Permalink
fix resolveFromRoute when using invokable controller
Browse files Browse the repository at this point in the history
  • Loading branch information
d8vjork committed Oct 20, 2022
1 parent b6e4330 commit 1646138
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Http/Concerns/ResolvesFromRouteAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}

/**
Expand Down

0 comments on commit 1646138

Please sign in to comment.