inserting data from a crud from one table into another table #1022
-
So I have a users table and a dues table. The dues table looks like this:
So the idea is users have to pay dues annually and we log when they paid and what they paid in the
On the crud for the My question is... how can I do this? Turns out you can add fields for columns that don't exist without issue. To simulate pulling the data from the DB I could add something like this to the array passed to
But what would I put in for the ??? And then there's actually saving the data. How would I do that? Laravel-Backpack/CRUD#51 (comment) mentions the
But idk if this is the best approach. I suppose another method would be to add three columns to my users table: Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hello @prescriptionlifeline This look like something relationship field can handle, in you case check pivot table docs you can add other attributes to this relation. Cheers. |
Beta Was this translation helpful? Give feedback.
-
Im glad you find the solution. I will close this issue, but please feel free to re-open or create a new one if needed. Cheers. |
Beta Was this translation helpful? Give feedback.
Hello @prescriptionlifeline
This look like something relationship field can handle, in you case check pivot table docs you can add other attributes to this relation.
Cheers.