Skip to content

Commit 66758cc

Browse files
authored
Merge pull request #27 from InteractionDesignFoundation/fix/serializable-closure-display
fix: handle SerializableClosure in action column display
2 parents 557095c + a18c2f0 commit 66758cc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Http/Controllers/Api.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ public function getRoutes()
2828
$routeMiddleware = [$routeMiddleware];
2929
}
3030

31+
$action = $route->action['uses'] ?? '';
32+
3133
return [
3234
'uri' => $route->uri,
3335
'as' => $routeName,
3436
'methods' => $route->methods,
35-
'action' => $route->action['uses'] instanceof \Closure ? 'Closure' : ($route->action['uses'] ?? ''),
37+
'action' => is_string($action) ? $action : 'Closure',
3638
'middleware' => $routeMiddleware,
3739
];
3840
})->values()->all();

0 commit comments

Comments
 (0)