Organize your Laravel routes for better and maintainable codesteemCreated with Sketch.

in laravel •  7 years ago 

Out of the box Laravel 5.5 provides 4 routes files api.php, channels.php, console.php and web.php.
The web.php route file is for our web interface, api.php is for APIs, console.php is for artisan command registration and channels.php is for broadcasting purpose.

We all know these things, so far nothing new in that right!

💡 What is the point of this post all about actually:

If you are working on a small application and you don’t have too many routes defined for your app then web.php is enough for you, but what if you have hundreds or more routes defined, for example routes for Admin level, for customers, for some other type of users (related to auth) and the common unprotected routes which are available for all type of visitors.

⚠️ Then keeping all the routes together to just a single route file will easily make your routes unmanageable.

Fore more details Please visit: https://medium.com/@thesourav/organize-your-laravel-routes-for-better-and-maintainable-code-4ad9b76aed0f![Organize-your-Laravel-routes-for-better-and-maintainable-code.jpg]

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!