Skip to content

Add Filament Relation Manager form support #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

schroeder-hesel
Copy link

Previously, the getFilamentAttributeNameAndLocale() function only handled attributes prefixed with "data.", as used by Filament resource forms. In the Relation Manager context, however, attributes appear as "mountedTableActionsData.." (e.g. "mountedTableActionsData.0.slug"), which caused issues.

This change updates the function to remove both "data." and "mountedTableActionsData.." prefixes via a regular expression before splitting off any locale part. It now correctly handles both Filament resource forms and Relation Manager attribute formats, ensuring the attribute name and (if present) the locale are parsed consistently.

…ms and Relation Manager forms

Previously, the getFilamentAttributeNameAndLocale() function only handled attributes prefixed with "data.", 
as used by Filament resource forms. In the Relation Manager context, however, attributes appear as 
"mountedTableActionsData.<index>." (e.g. "mountedTableActionsData.0.slug"), which caused issues. 

This change updates the function to remove both "data." and "mountedTableActionsData.<index>." 
prefixes via a regular expression before splitting off any locale part. It now correctly handles 
both Filament resource forms and Relation Manager attribute formats, ensuring the attribute name 
and (if present) the locale are parsed consistently.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant