Best solution for dynamic Model attribute fields via Relationmanager
Hi all,
I am new to Filament and Laravel, trying to get the following working.
I have Tenant, CompanyGroup and CompanyGroupAttribute Model.
A Tenant should create CompanyGroupAttributes which should then act as Form Fields for CompanyGroup. So I have different CompanyGroupAttributes per Tenant. A CompanyGroup belongs to one Tenant and should have all related CompanyGroupAttributes.
The idea behind this is to provide custom attributes to each Tenant for their CompanyGroups.
What would be the best implementation for this?
Atm I have a belongsToMany relationship for CompanyGroup and CompanyGroupAttribute to have a pivot table to store the value for each custom attribute. However I am struggling to set the pivot table value on CompanyGroup creation in my CompanyGroupRelationManager.
I am sure I made a mistake choosing the wrong relations or missing a logic part.
Any ideas?
Appreciate your help π Thanks
2 Replies