-
Notifications
You must be signed in to change notification settings - Fork 1.5k
-
Is it possible to use the exists
validation rule when using embedded models?
Let's say I have my Foo
model which EmbedsMany
Bar
models. In my DB I have something like this:
{
"_id": "...",
"foo_attr": "val",
"bars": [
{
"_id": "...",
"bar_attr": "val"
},
// More bars...
]
}
Is there a way I could use Laravel's exists
rule for validating a bar id? Maybe something like this?
'bar_id' => 'exists:foos.bars,_id'
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment