Listing with Pivot Attributes when Pivot attribute is an Accessor

I have 3 tables, reports, users and report_user. report_user is the pivot table and it has an attribute named "permission". I created a model for report_user in order to define an Accessor for "permission" as its currently stored as a single character string and when I output it I want it to read the full word of the permission. The permission pivot attribute (which is the single character string) shows up fine in the relationship manager table as a column by simply accessing with "permission", when I try to use the accessor "display_permission" it doesn't show up. I have setup my belongsToMany relationships fine for both sides of the relationship and its using the ReportUser class so it should have the accessor in scope. Is it possible to use an accessor defined on a Pivot Table model in Filament 3?
Solution:
I resolved this by prefixing the attribute with "pivot." so in this instance "pivot.permission" returned the value as defined by the Pivot Model Accessor where "permission" only returned the single character string.
Jump to solution
1 Reply
Solution
beachbound
beachbound6mo ago
I resolved this by prefixing the attribute with "pivot." so in this instance "pivot.permission" returned the value as defined by the Pivot Model Accessor where "permission" only returned the single character string.