Laravel Pro Tips

Laravel Pro Tips

Top 20 Laravel Eloquent Enhancements

Eloquent shines as Laravel's key feature, and a vast range of add-on packages further enhances it. We'll explore a handpicked selection that's set to elevate your Laravel toolkit in this article.

Laravel Pro Tips's avatar
Laravel Pro Tips
Nov 06, 2023
∙ Paid
Share

black laptop computer turned on displaying blue screen
Photo by Mohammad Rahmani on Unsplash

1. Simplified Query Building with Spatie Laravel Package

The spatie/laravel-query-builder package enhances your Laravel project, making it simple to apply filters, sort results, and manage Eloquent relationships directly through user requests.

For example, your website users could use a URL like this to interact with your data:

  • To find all users named John: /users?filter[name]=John

  • To include related posts in the user data: /users?include=posts

  • To sort users by their ID: /users?sort=id

In your controller, you can handle these requests effortlessly:

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 Laravel Pro Tips
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture