1

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?

patricus
  • 59,488
  • 15
  • 143
  • 145
Koga
  • 555
  • 1
  • 5
  • 18
  • 2
    Looks like it was removed by taylor https://github.com/laravel/lumen-framework/commit/b63c9525740082c68752efd4bb5aa421dda73213 as part of 'major slimming' think this is related to him really trying to trim down Lumen to the minimum. Suppose you can implement the method yourself but not ideal. – Mark Davidson Jan 04 '16 at 16:29
  • @MarcinNabiałek on Lumen releases page it says 5.1.6 as the latest version at the time of this writing: https://github.com/laravel/lumen-framework/releases where did you see Lumen 5.2.6? – jfoliveira Jan 05 '16 at 14:41
  • 1
    @jfoliveira My fault, I misread and thought it was about Laravel and not Lumen – Marcin Nabiałek Jan 05 '16 at 14:45

2 Answers2

1

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.

jfoliveira
  • 2,138
  • 14
  • 25
0

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

Marshall Davis
  • 3,337
  • 5
  • 39
  • 47