Jeffries free video series The from scratch series covers the basic crud ( create, read, update, delete) you will need.
May 19, 2020
1
Level 1
Storing Data from View/Controller to Relational DB
I have three table
- Users (HasOne -> UserDetails)
- Addrs (HasOne -> UserDetails)
- UserTypes (belongsToMany -> UserDetails)
- UserDetails <<-- this is a look up/Pivot table, stores ID, UserId, AddrId, UserTypeID (BelongsTo. . .each of the classes)
I have used this approuch to store all the application addresses in one area and avoid the duplication of storing addresses for each of the users.
The structure is now set up, I have come to creating the view and controller. How do I insert the data into each of the separate tables and then link them to the correct records in the UserDetails table such as the entered address and user?
The penny is just not logically dropping, a link to a video or advice would be a class act!
Thanks in advance.
Please or to participate in this conversation.