How to get routes and namespace in Lumen 5.2?

1.2k Views Asked by At

Lumen 5.2 has not been officially released yet, but as you can see in the GitHub repository the methods app()->getRoutes() and app()->getNamespace() will be no longer available.

Are there any other ways to get the routes and the namespace in Lumen 5.2?

2

There are 2 best solutions below

0
On

As of version 9 this has moved to the router component. So it would be accessed via app()->router->getRoutes().

0
On

The getRoutes method was removed as part of a code cleanup in Lumen 5.2.

This pull request brought it back so the method is available again and no alternative approach is required now.