How to show the list of routes in laravel 7?

Shop Forums Laravel Discussion How to show the list of routes in laravel 7?

Viewing 1 reply thread
  • Author
    Posts
    • #7724
      Projects Plaza
      Participant

      We can see the all route list in laravel 7 with following command.
      php artisan route:list

    • #9243
      umairhussaingt
      Participant

      Route::getRoutes() returns a RouteCollection. On each element, you can do a simple $route->getPath() to get path of the current route.

      Each protected parameter can be get with a standard getter.

      Looping works like this:

      $routeCollection = Route::getRoutes();

      foreach ($routeCollection as $value) {
      echo $value->getPath();
      }

      Also, after the laravel installation of 8, the namespace property in app/Providers/RouteServiceProvider.php is now null

Viewing 1 reply thread
  • You must be logged in to reply to this topic.