1 year ago

Multiple Polymorphic relationship in one model

Posted 1 year ago by diegopr83

Hi everybody, i need help with this situation:

I have three tables:

products: -id -description

batches -id -description

and i need a third one:

exchanges: -id -exchange1 -exchange2

These exchange1 and exchange2 could be a product or a batch, so these need to be polymorphic.

but i don't know how to insert a new row using eloquent.

please help!!

Please sign in or create an account to participate in this conversation.