Skip to main content
PP

Filament 3 custom widgets with shared date filters on dashboard

Priya Patel Laravel & PHP 288 views
Working with Filament 3 and trying to create a dashboard with date-filtered widgets. I want all widgets on the page to respond to a shared date range picker. I have seen HasFiltersForm in the Filament docs but I am not sure how to wire it up so that all widgets share the same filter state. Has anyone implemented shared dashboard filters across multiple Filament widgets? I am building an analytics dashboard for an e-commerce project and need revenue, orders, and customer widgets to all filter by the same date range. Any guidance would be appreciated.

1 Reply

Best Answer
MR
Marcus Rivera 4 months ago
Priya, you need to use HasFiltersForm on the Dashboard Page class, not on individual widgets. Then each widget can access the filter values through the page. In your Dashboard page class, use the HasFiltersForm concern and define a filtersForm method that returns a Form with DatePicker fields for startDate and endDate. Then in each widget, you access the current filter values through the filters property. The widgets re-render automatically when filters change.

Post a Reply

Engr Mejba Ahmed

Engr Mejba Ahmed

Claude Code Expert · Online

👋

Hey there!

Quick Actions

WhatsApp Instant reply

Chat on WhatsApp

+880 1723 741224 · Instant reply

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

[email protected]

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support