diff --git a/src/Models/Route.php b/src/Models/Route.php index 62e56dd..126284e 100644 --- a/src/Models/Route.php +++ b/src/Models/Route.php @@ -145,7 +145,10 @@ public function getMiddlewares(): array $middlewares = array_merge($middlewares, $this->route->{$method}()); } - return array_values($middlewares); + return Arr::of($middlewares) + ->map(fn (mixed $middleware) => is_callable($middleware) ? 'closure' : $middleware) + ->values() + ->toArray(); } public function getSummary(): ?string