Getting the route detail by name

- 1 answer

Ad

Is it possible to get the details of a route by it's name like the controller and action name that it uses?

I went through the documentation and it only has such functionality listed for the current route i.e. current(), currentRouteAction() etc. Is it possible to get the detail of a route, action and controller to be specific, by it's alias/name?

Ad

Answer

Ad

I think, you can get it in this way

Route::getRoutes()->getByName($name);

or

Route::getRoutes()->getByAction($action);

Ad
source: stackoverflow.com
Ad