mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 21:34:03 +00:00
538 B
538 B
| title | tweet_id | thread_slug | author_username | images | created_at | slug | |
|---|---|---|---|---|---|---|---|
| Use whereBelongsTo() and relation()->is() instead of comparing ids manually | 1466810182265032710 | weekly-thread-2021-48 | archtechx |
|
2021-12-03T16:42:54+00:00 | use-wherebelongsto-and-relation-is-instead-of-comparing-ids-manually |
🔥 Tip: You don't have to use "related_id"-type columns in database queries or value comparisons.
Laravel understands your relations and lets you write much cleaner code.