F
Filament9mo ago
Prodex

Adding filter to custom widget

Hi, how can I implement a filter (start and end date) to a custom widget? Should I use a custom action for that or can I utilize filament filters for that? Thank you!
3 Replies
Prodex
Prodex9mo ago
can anyone give me an example on this?
awcodes
awcodes9mo ago
Filters only work for tables. A widget is just a Livewire component. Add some inputs and a submit action, when the submit button is pressed update the widget data. You could even use the forms in your widget if you wanted to.
samsasba
samsasba9mo ago
You can check https://github.com/sakanjo/laravel-easy-metrics which have filters that work out-of-the-box with filament
GitHub
GitHub - sakanjo/laravel-easy-metrics: Generate metrics with ease a...
Generate metrics with ease and precision. Contribute to sakanjo/laravel-easy-metrics development by creating an account on GitHub.