© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
11 replies
cakan

Widget with datepicker

I'm trying to make a widget that will be displayed on a Dashboard. Widget displays some statistics based on the selected date.

I've created a Widget with a form and added form to the layout, but I'm having trouble how to get date from the form and pass it to my report function.

This is my code:
class MonthlyReport extends Widget implements HasForms
{
    use InteractsWithForms;

    protected static string $view = "filament.resources.user-resource.widgets.monthly-report";

    public function getMonthlyReports(): array
    {
        return ActionHistoryHelper::getReport(Carbon::now()->format('Y-m-d'));
    }

    public function form(Form $form): Form
    {
        return $form->schema([DatePicker::make('date')]);
    }
}
class MonthlyReport extends Widget implements HasForms
{
    use InteractsWithForms;

    protected static string $view = "filament.resources.user-resource.widgets.monthly-report";

    public function getMonthlyReports(): array
    {
        return ActionHistoryHelper::getReport(Carbon::now()->format('Y-m-d'));
    }

    public function form(Form $form): Form
    {
        return $form->schema([DatePicker::make('date')]);
    }
}

View is just displaying the form and the data received from
getMonthlyReports
getMonthlyReports
function.

How do I pass the date value from form to the
getMonthlyReports
getMonthlyReports
function and refresh the widget?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Filament DatePicker Widget
FilamentFFilament / ❓┊help
2y ago
Repeater with DatePicker
FilamentFFilament / ❓┊help
2y ago
Dynamic min max datepicker filter in widget table
FilamentFFilament / ❓┊help
3y ago
datepicker
FilamentFFilament / ❓┊help
2y ago