F
Filament12mo ago
Damien

Extracting form submission data when there are repeaters and relationships

Hey everyone, appreciate it is getting close to Christmas / Holidays for many so I'll try and keep it brief! I am in a scenario where I have stock_products and bom_products and when creating a bom_product, I can select multiple stock_products using a repeater. The data for this is then saved in a bom_stock_products table. On my BomProduct model, I have a method stockProducts() which the repeater uses for the relationship and everything seems to be working fine. What I now need to do, is calculate a cost_price for the bom_product and this is based off of the cost_price for all of the stock_products multiplied by the quantity. The issue I am having is that the $data variable does not contain any information on the stock_products or their id's so that I can query the stock_products table. How would one usually get around this or how can I include the data from the repeater with the relationship to calculate this value.
2 Replies
ianclemence
ianclemence11mo ago
How did you solve this?
Damien
DamienOP11mo ago
I never got around to solving it sadly.
Want results from more Discord servers?
Add your server