🔥 Laravel Tip: Prevent model hydration on Eloquent queries
Nov 18, 2022
If you want to take advantage of Eloquent features (ex: scopes, soft deletes, etc).
But you don't want the query to hydrate models for performance reasons. You can call the `toBase` method on your query.
But you don't want the query to hydrate models for performance reasons. You can call the `toBase` method on your query.
![tip-image-0](https://res.cloudinary.com/dpmeu3otn/image/upload/v1668739760/tips/q42cmyrd5bu9ft7dtdxv.png)
Other tips:
🔥 Laravel Tip: orderByPivot
Nov 4, 2022
🔥 Laravel Tip: Streaming Results Lazily
Apr 2, 2022