Eloquent is a great feature of Laravel, but also great is the list of packages that add more features on top of the framework. Let's explore them, in this article!
The title says 20 packages, but there are quite a few alternatives mentioned along the way, so the actual number is even bigger than this. Ready? Let's jump in!
1. spatie/laravel-query-builder
GitHub: https://github.com/spatie/laravel-query-builder
This package allows you to filter, sort and include eloquent relations based on a request.
Your users may type something like:
- /users?filter[name]=John
- users?include=posts
- users?sort=id
Then, your Controller will filter the records based on those parameters.
Code example:...