RelationManager calling Resource Form not also using mutateFormDataBeforeSave

I have a form in my UserResource page. I don't want to have to recreate the form, so I'm doing this in my TeamMembersRelationManager:
public function form(Form $form): Form
{
return UserResource::form($form);
}
public function form(Form $form): Form
{
return UserResource::form($form);
}
This works great except that on the UserResource form I have a phone field, and I'm using the mutateDataBeforeCreate and mutateDataBeforeSave methods to strip any non-numeric character from the input. Filament doesn't seem to be also using those methods when referenced from the relation manager. I don't know where the form is being handled when it's done like this. I would expect it to be handled by the CreateUser or EditUser Page, but it doesn't seem to be doing that. I've also tried adding the methods to my TeamMembersRelationManager class as well, but that's not working. Am I better off just copying the form code to my relation manager, I hate doing that as it's not DRY..
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server