mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 05:14:04 +00:00
* Use Author::updateOrCreate instead of firstOrCreate * Weekly tips #4
This commit is contained in:
parent
f1e283e142
commit
e907eba3dd
16 changed files with 140 additions and 4 deletions
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
title: 'Use Eloquent scopes to clean up complex relation queries'
|
||||
tweet_id: '1487081935478276103'
|
||||
thread_slug: weekly-thread-2022-04
|
||||
author_username: archtechx
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/FKCIrumVQAcD8RB.jpg'
|
||||
created_at: 2022-01-28T15:15:36+00:00
|
||||
slug: use-eloquent-scopes-to-clean-up-complex-relation-queries
|
||||
---
|
||||
🔥 Eloquent scopes pair very well with complex relation queries
|
||||
|
||||
Scopes should also have @method annotations. They make the model more self-documenting & better supported in IDEs
|
||||
Loading…
Add table
Add a link
Reference in a new issue