Skip to content

Commit 21c7779

Browse files
authored
Merge pull request #190 from rakutentech/feature/serialization
Fix #187 Recognize serialized Closure
2 parents 3f46117 + 42fc653 commit 21c7779

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/LaravelRequestDocs.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Rakutentech\LaravelRequestDocs;
44

55
use Illuminate\Http\Request;
6+
use Illuminate\Routing\RouteAction;
67
use Illuminate\Support\Collection;
78
use Illuminate\Support\Facades\Route;
89
use Illuminate\Support\Str;
@@ -174,7 +175,7 @@ public function getControllersInfo(array $onlyMethods): Collection
174175
$method = '';
175176

176177
// `$route->action['uses']` value is either 'Class@method' string or Closure.
177-
if (is_string($route->action['uses'])) {
178+
if (is_string($route->action['uses']) && !RouteAction::containsSerializedClosure($route->action)) {
178179
$controllerCallback = Str::parseCallback($route->action['uses']);
179180
$controllerFullPath = $controllerCallback[0];
180181
$method = $controllerCallback[1];

0 commit comments

Comments
 (0)