0

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.

Mani
  • 3
  • 2
  • A good IDE like PHPStorm or VSCode, with the proper PHP plugins, does most of this for you. I can click a route definition to get to the controller function, I can click a view() call to get to its Blade file, etc. – ceejayoz May 22 '23 at 13:15

2 Answers2

0

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

Jesus Erwin Suarez
  • 1,571
  • 16
  • 17
  • 1
    you need to add some explaination about your answer. so please add meaning of `-v` & `-h` option flag in your answer. what is use of that flag – Harsh Patel May 22 '23 at 04:41
0

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();
    $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

Kamran Allana
  • 543
  • 1
  • 6
  • 25