Add data to two tables from one form
I have 3 tables
employees
, departments
and employee_departments
I did it this way because it created a cyclic dependency with just 2 tables, now let's say I have departments created in the department table and now am adding an employee I want add the entry for the employee_department
table at the same time from a second section in the forms wizard, but can someone tell me how to properly configure this? or at least a link to a documentation.


Solution:Jump to solution
This explains how to create pivot table entry. https://filamentphp.com/docs/3.x/panels/resources/relation-managers#creating-with-pivot-attributes
5 Replies
I would also like to point out that I'd like to select the department using the department name instead of the ID
in the demo, when you create a new order you have get the 2nd part of the wizard that let's you select order items, and order items is a separate table i want to know how to add data to two tables like that from the same form

Solution
This explains how to create pivot table entry. https://filamentphp.com/docs/3.x/panels/resources/relation-managers#creating-with-pivot-attributes