1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 13:24:03 +00:00
laravel-tips/content/tips/wanna-update-a-set-of-eloquent-models-and-have-the-change-updated-in-the-database-and-in-your-in-memory-instances-but-dont-wanna-incur-a-database-query-for-each-model.md
2021-04-06 18:27:18 +02:00

607 B

title tweet_id thread_slug author_username images created_at slug
Wanna update a set of Eloquent models and have the change updated in the database and in your in-memory instances, but don't wanna incur a database query for *each* model? 1253524892055560193 1-rt-1-tip timacdonald87
https://pbs.twimg.com/media/EWVoC3jVcAEg0JX.jpg
2021-04-06T16:07:49+00:00 wanna-update-a-set-of-eloquent-models-and-have-the-change-updated-in-the-database-and-in-your-in-memory-instances-but-dont-wanna-incur-a-database-query-for-each-model

Custom collections got you sorted. Love these methods.