Kamran Ahmed
Kamran Ahmed

Reputation: 12438

Getting the route detail by name

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?

Upvotes: 0

Views: 232

Answers (1)

Nyan Lynn Htut
Nyan Lynn Htut

Reputation: 657

I think, you can get it in this way

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

or

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

Upvotes: 1

Related Questions