diff --git a/src/Commands/ExportPostmanCommand.php b/src/Commands/ExportPostmanCommand.php index 0be4275..a5c68fe 100644 --- a/src/Commands/ExportPostmanCommand.php +++ b/src/Commands/ExportPostmanCommand.php @@ -6,6 +6,7 @@ use Illuminate\Console\Command; use Illuminate\Contracts\Config\Repository; use Illuminate\Foundation\Http\FormRequest; +use Illuminate\Routing\RouteAction; use Illuminate\Routing\Router; use Illuminate\Support\Facades\Storage; use Illuminate\Support\Str; @@ -140,6 +141,11 @@ public function handle(): void protected function getReflectionMethod(array $routeAction): ?object { + // Hydrates the closure if it is an instance of Opis\Closure\SerializableClosure + if (RouteAction::containsSerializedClosure($routeAction)) { + $routeAction['uses'] = unserialize($routeAction['uses'])->getClosure(); + } + if ($routeAction['uses'] instanceof Closure) { return new ReflectionFunction($routeAction['uses']); }