Sorry this might be dumb, but how can I extend a method that returns a component with additional...
This might be a PHP question more than a Filament question but I'll ask anyway.
I'm trying to extend the default login of Filament to add a tab index attribute to the remember me input. This is what I tried:
Unfortunately this doesn't work, there is no
extraInputAttributes
method on the component returned from the parent method.
I could just copy the method to override it and add my change but I wanted to avoid any issues with future updates to this method from Filament.7 Replies
Can you confirm the
component
import ? should be Filament\Forms\Components\Component;
confirmed
🤔 the docs says exactly what you did https://filamentphp.com/docs/3.x/forms/fields/getting-started#adding-extra-html-attributes
What does dd($component) show?
Looks like I may have spoke too soon when I said "doesn't work". It does in fact work with the way I did it. It looks like it's just Phpstorm complaining for no reason.
With that being said, do you know how to make Phpstorm not recognize it as a method not found? 🤣
Solution
It should recognize it. Maybe it just needs to reindex.