mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 05:14:04 +00:00
598 B
598 B
| title | tweet_id | thread_slug | author_username | images | created_at | slug | |
|---|---|---|---|---|---|---|---|
| You can convert Eloquent Collections back to a Query Builder instance | 1464247625046114305 | weekly-thread-2021-47 | RBilloir |
|
2021-11-26T15:00:12+00:00 | you-can-convert-eloquent-collections-back-to-a-query-builder-instance |
A tiny tip about #laravel eloquent.
To retrieve the Query Builder after filtering the results: you can use ->toQuery().
The method internally use the first model of the collection and a whereKey comparison on the Collection models.