如题,现需要在一个方法中获取所有路由的ActionName,而不只是获取当前的ActionName,该如何实现呢?
类似这样
foreach(Route::getRoutes() as $route){ $data[] = [ "controller" => $route->action["controller"], "name" => $route->action["as"], "uri" => $route->uri, ]; }
Route是自带的facade
548k questions
547k answers
4 comments
86.3k users