Filament v4: Adding extra fields on ViewRecord page
Hi all, I have a use case where I have a ViewRecord page which shows data in a infolist. But I want to add some extra fields by calling an api. I prefer to override the method
mutateFormDataBeforeFill
https://filamentphp.com/docs/4.x/resources/viewing-records#customizing-data-before-filling-the-form but looks like it is never called. How can I add new fields to the infolist.
To get the mutateFormDataBeforeFill
method to work I had to override the mount method like so:
But after this I still don't see the new appended data in the infolist. Any help is appreciated.2 Replies
I don't know if it would work but I guess you could call it inside the ->state method of the infolist.
Something like this.
Infolists aren't forms that's why
mutateFormDataBeforeFill()
isn't called.