I’m building an e-commerce website to save models of variant products using Laravel: I have to save multiple records in a POST request, and the problem is I have to get that foreign key ID of previous records to save the next model (like retrieving the variant_option’s id to variant_value id).
I don’t know any way to save a model by a tree like this image in Laravel. Can anyone give me a sketch or idea to do this?
I intended to using this database: database