Define where + default value on relationship level (similar to withPivotValue
)
#51239
Unanswered
Propaganistas
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When defining BelongsToMany relationships, there's a
withPivotValue
method to configure awhere
clause and a corresponding default value for new related models in one go (see laravel/ideas#872):Before:
After:
In my opinion the very same feature would be quite useful for other relationship types as well?
Beta Was this translation helpful? Give feedback.
All reactions