CRUD : Adding Multiple Child Records (1-n relationships) on related CRUD form?
See original GitHub issueHey,
If you feel this is too redundant or not the place to pose this question, feel free to blast this post away. @tabacitu is usually super-tuned in to these posts. I have searched through the tickets and Google, but I’m not sure I am asking the question the right way… or if there is even an answer out there…
I am running into situations where I have a Model that I would like to add multiple related (child) records too, using just one CRUD form. Some examples would include adding multiple files… but let’s start small. I have found the following posts that have similar topics, but not clear answer on the best way to do this.
Is the best way to use the table
Field Type? https://laravel-backpack.readme.io/docs/crud-fields#section-table But, I guess the drawback is not having validation on the child records?
A similar tutorial to this one would be cool: https://backpackforlaravel.com/articles/tutorials/nested-resources-in-backpack-crud
So, an example would be where I have a Journey model and would like to add multiple Chapters to the Journey directly on the same Journey CRUD form.
Let me know if this question makes sense… and any suggestions/advice you can share.
Thanks, JFK
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (4 by maintainers)
Update: We still don’t have a built-in solution for this.
But a possible solution would be to have a 1-n field that allows you to add items (plus button that opens a modal with a form for the child record, hit save and it would be added to the db and selected in the select). It’s mentioned elsewhere in our Github as “adding items on the fly”.
This third-party package had a solution for Backpack v3, but for Backpack v4 we’re working on a first-party solution. I’ll try to update this thread as we work towards a complete solution for Backpack v4.
Sorry for the bad news.
Sorry… I realized this isn’t a bug and should be posted via another channel: http://stackoverflow.com/questions/43723259/crud-adding-multiple-child-records-1-n-relationships-on-related-crud-form
Closing this “Issue”.