N
N
Northern Lights2019-11-05 10:45:35
Laravel
Northern Lights, 2019-11-05 10:45:35

How to save related entities in one action more correctly?

Hello members!
The question is. There are some entities that need to be saved in one action, within one transaction.
These are different tables having foreign keys on top of each other.
Within the framework of the Laravel architecture - what is the right way to do it?
1. How to distinguish data in one form between different models? Through input arrays like fileld[model]?
2. How are errors handled in this case? Will Request-classes with validation and error output work normally?
3. What should the code for saving multiple/linked models look like?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question