can i add action button to a stat widget?
I have this widget card. i want to add a button to it and when the user click it I want to delete a record inside the database. Is it possible to add action and how can I do that?
7 Replies
I think you'll have to use a custom component
How i use custom component as a widget? 🤔
I think you can use this example to dispatch some event or redirect using
->url()
method
https://filamentphp.com/docs/3.x/widgets/stats-overview#adding-extra-html-attributes-to-a-statYeah, I can call a function using
wire:click
. Currently, I'm using this method. Right now it's affecting the whole card. But if I can add a small button inside the Stat card and add action to that button it would be awesome. Such as the Sign Out button on the default Auth widget. @leandro_ferreiraYou can create a custom widget
https://filamentphp.com/docs/3.x/panels/dashboard#custom-widgets
Okay. I will try this and get back here if need help. Thank you ❤️
Hello, kinda an old issue, but i think i'tll be cool to add actions button to the stat widget