Add a trait to every filament page
My project is entirely filament. I recently discovered a package that wants me to use a trait in each of the Edit, View, List or Create pages. Is there a way to boot every page always with that trait?
2 Replies
you can customize the stubs files and add the needed trait
https://filamentphp.com/docs/3.x/support/stubs
but wont be helpful for the existing classes.
Technically, you can create your own "base" page class that would extend the filament class from vendor, and add a trait there.
And then extend all your edit/create/list pages from that new custom class.
Not sure if I would do it personally, as it puts the complexity on the other side...
Which package was it? Maybe I could come up with some other suggestions