PHP – Laravel Auto Routes

In this article, we are talking about laravel auto routes packages, if you really like Laravel’s built-in routing definitions then definitely you like this Auto Routes  Package.

Let’s take a look at this package in more deep

When we defined the laravel route like this

Then Laravel resource routing assigns the typical “create”, “read”, “update”, and “delete” (“CRUD”) routes to a controller with a single line of code. You cannot assign any route apart from this route, so if you want to use any route then you need to add another line to the route file.

So in order to tackle this issue, Auto Routes  Package provides a feature where that generates routes by discovering public methods from a controller using auto-discovery.

Auto Routes Packages Learn More 

For this package Supported Laravel Versions: >= 6.x

Run the following command directly in your Project path to Install using composer

composer require izniburak/laravel-auto-routes

After that, you should publish the config file

php artisan vendor:publish --provider="Buki\AutoRoute\AutoRouteServiceProvider

Now you can use the Auto Routes After successfully run the above command.

You can use AutoRouteFacade in route web.php and api.php files like this

 use Buki\AutoRoute\AutoRouteFacade as AutoRoute; 

While most of the developers loved to use Laravel’s built-in routing definitions then this package is good to use.

Add a Comment

Your email address will not be published. Required fields are marked *