Answer the question
In order to leave comments, you need to log in
What is the best way to design a database in Laravel in my case?
Gentlemen, help me correctly and correctly describe the following data model in the language of the database and relationships in laravel, I have been suffering for the second day, I can’t figure out how to do it correctly:
1. Users come to the site. They may be unauthorized and will be asked to log in before paying, but that doesn't matter.
2. Each user has the option to fill out one of three different forms. DIFFERENT. They have one thing in common - a block of postal addresses, it is the same for everyone and, I think, it can be somehow isolated into a separate table.
3. The user fills in as many different forms as he wants and can pay for them later. And then managers contact him offline.
Thus, it turns out that we have three main entities: Users, Forms and Payments for them.
1. Many payments can belong to each user;
2. Each specific payment belongs to one user.
3. Moreover, each payment must be somehow related to the form to which it also belongs (for which it was paid).
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question