How to List All Available Routing in Laravel Web Application

Posted on

Introduction

This article has a specific purpose and the content will have a relation to the subject of listing all available routing in Laravel Web Application. The main function for printing the route available in the application based on Laravel framework is quite important. It is to check whether the certain URL of the route is really exist and available. If the route is in the list, there is a big chance that the URL of the route will have a specific output in the web page. So, everyone asking or trying to access a specific page cannot be reckless.

Everyone cannot just try a random URL address of the web-based application powered by Laravel framework. The one exist and available with a higher chance that the URL address will present a certain page is the one available in the route list. Using the command for listing the available route, it will give a correct information about which routes is available for further access.

Printing the route list

The command for printing those routing available in the Laravel Web Application exist as follows :

php artisan route:list

Make sure to execute the above command in the command line interface. Make sure that the current working directory is in the root folder of the project.

[root@hostname ~]# php artisan route:list
+--------+----------+-----------------------------+----------+------------------------------------------------------------+---------------------------------+
| Domain | Method   | URI            |Name  |Action                                    |Middleware |
+--------+----------+-----------------------------+----------+------------------------------------------------------------+---------------------------------+
|        | GET|HEAD | /              |      | App\Http\Controllers\frontend@index      |web |
|        | POST     | _ignition/execute-solution  |      | Facade\Ignition\Http\Controllers\ExecuteSolutionController |... |
|        | GET|HEAD | _ignition/health-check | | FacadeIgnition\Http\Controllers\HealthCheckController |... |
| | GET|HEAD | _ignition/scripts/{script} | | Facade\Ignition\Http\Controllers\ScriptController |... |
| | POST | _ignition/share-report | | Facade\Ignition\Http\Controllers\ShareReportController |... |
| | GET|HEAD | _ignition/styles/{style} | | Facade\Ignition\Http\Controllers\StyleController |... |
| | GET|HEAD | api/user | | Closure |api,auth:api |

The artisan command in this context exist in the root folder of the Laravel framework web-based application. It is exist only after the initialization of the folder into a Laravel framework web-based application is done. As in the output above, there are several available routes exist. Actually, one of that route is the main route. That route URI is in the first line in the list. The URI of the main route is  ‘/’. So, one of a way for accessing the web-based application using Laravel framework is using the URI of ‘/’.

Leave a Reply