Skip to content

Commit 8632d8b

Browse files
Merge pull request rakutentech#45 from rakutentech/feature/invoke
Fixes rakutentech#43 __invoke
2 parents 7649868 + 585a0f4 commit 8632d8b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/LaravelRequestDocs.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,13 @@ public function getControllersInfo(): array
7474
}
7575

7676
try {
77+
$actionControllerName = $route->action['controller'] ?? $route->action["0"];
7778
/// Show Pnly Controller Name
78-
$controllerFullPath = explode('@', $route->action['controller'])[0];
79-
$getStartWord = strrpos(explode('@', $route->action['controller'])[0], '\\') + 1;
79+
$controllerFullPath = explode('@', $actionControllerName)[0];
80+
$getStartWord = strrpos(explode('@', $actionControllerName)[0], '\\') + 1;
8081
$controllerName = substr($controllerFullPath, $getStartWord);
8182

82-
$method = explode('@', $route->action['controller'])[1];
83+
$method = explode('@', $actionControllerName)[1] ?? '__invoke';
8384
$httpMethod = $route->methods[0];
8485
foreach ($controllersInfo as $controllerInfo) {
8586
if ($controllerInfo['uri'] == $route->uri && $controllerInfo['httpMethod'] == $httpMethod) {

0 commit comments

Comments
 (0)