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/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

15 lines
No EOL
611 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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