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