Editing pivot table relating 3 tables

I have 3 tables, Users, Departments, and Unit. Each unit has departments and departments have users.
I want to be able to allow access to multiple departments of multiple units and control it from a form within User resource.
How can I approach this? I'm a bit new to Filament

An example of the pivot table can look like:
| user_id | unit_id | department_id |
+---------+---------+---------------+
| 1       | 1       | 1             |
+---------+---------+---------------+
| 1       | 1       | 2             |
Was this page helpful?