skip to Main Content

I had to do some changes on a complex Laravel project which I was not familiar. It took quite some time to navigate and find correct files. Is there any package/tool for generating overview of a Laravel project. I would prefer to generate something like this.

route             ->   controller@function             ->   models       ->    view
------------------------------------------------------------------------------------------
reports/orders/   ->  ReportsController@print_orders   -> Report, Order  -> reports/index
...

I am aware of php artisan route:list but it doesn’t show all the details.

2

Answers


  1. Try running this: php artisan r:l -v and php artisan r:l -h

    Login or Signup to reply.
  2. Not sure about models and views but you can do it by creating custom console command for that or you can create a view for it:

    Artisan::command('route:list', function () {
        $routeCollection = Route::getRoutes();
        dd($routeCollection);
        $this->comment("Methods, URI|");
        $this->comment("-----------------------------------");
        foreach ($routeCollection as $value) {
            $this->comment($value->methods()[0].", ".$value->uri());
        }
    })
    

    Possible methods which can be use are in the documentation

    You can get help from here as well

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search