Level 73
Jan 17, 2020
4
Level 13
How to get a list of registered route in specific route file
Is it possible to get all registered route only in web.php not on any other files like api, ?
Level 73
$routes = [];
foreach (Route::getRoutes()->getIterator() as $route){
if (strpos($route->uri, 'api') === false){
$routes[] = $route->uri;
}
}
dd($routes);
Please or to participate in this conversation.