Create new relations from the parent screen #2610
Unanswered
joshhornby
asked this question in
Q&A
Replies: 1 comment
-
I have used the Relations field for something like that. Saving the relation is not difficult. Saving the product and then sync the relation data. In my case I was assign tags from a different table. $product->save();
$product->tags()->sync($tags); |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Hi,
Just want to sanity check with the community, I'm looking to offer my users the ability to create relations inline from the parent screen.
In this example I have 2 models,
Product
andProductVariants
On the
Product
model I have a relationship like soOn my Orchid
ProductScreen
I want to allow users to create newProductVariants
whilst they're viewing / editing a certain product.So my question is what's the correct way of doing this in Orchid?
I could use the
Matrix
table but this doesn't quite feel right as handling when a user removes a variant and then saving this back to the DB would be a little tricky.The
Relation
field looks good, but doesn't offer an easy way to create a new relation.Thanks
Beta Was this translation helpful? Give feedback.
All reactions