1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 05:14:04 +00:00
laravel-tips/content/tips/you-can-manually-set-the-relation-of-a-model-using-setrelation-method.md
Samuel Štancl 3f631cf1d2 Week 31/2022
2022-08-06 01:03:07 +02:00

611 B
Raw Permalink Blame History

title tweet_id thread_slug author_username images created_at slug
You can manually set the relation of a model using `setRelation` method 1555543660678156288 weekly-thread-2022-31 freekmurze
https://pbs.twimg.com/media/FZUmDyfXkAY7qyU.jpg
2022-08-05T13:18:03+00:00 you-can-manually-set-the-relation-of-a-model-using-setrelation-method

Eloquents setRelation is a very powerful method when used well. Heres how I used it to solve a performance problem in @OhDearApp

https://freek.dev/2311-increase-performance-by-using-eloquents-setrelation-method

#laravel #php #performance