This project demonstrates how to build a multi-widget analytics dashboard powered by the laraveldaily/filawidgets package, with widgets like SparklineTableWidget, BreakdownWidget, HeatmapCalendarWidget, ProgressWidget, and CompletionRateWidget.
This project uses five widget types from the laraveldaily/filawidgets package — SparklineTableWidget, BreakdownWidget, HeatmapCalendarWidget, ProgressWidget, and CompletionRateWidget — organized into three dashboard presets with shared date-range filtering.
git clone.env.example file to .env and edit database credentials therecomposer installphp artisan key:generatephp artisan storage:linkphp artisan migrate --seed (it has some seeded data for your testing)/admin and log in with credentials [email protected] and password.
The dashboard extends Filament's BaseDashboard with HasFiltersForm to add two toggle-button filters: a preset selector (Revenue / Growth / Operations) and a date range selector (7 / 30 / 60 days). Each preset loads a different set of five widgets.
app/Filament/Pages/Dashboard.php
class Dashboard extends BaseDashboard{ use HasFiltersForm; public function getColumns(): int|array { return [ 'md' => 2, 'xl' => 6, ]; } public function filtersForm(Schema $schema): Schema { return $schema->components([ ToggleButtons::make('preset') ->default(DashboardPreset::Revenue->value) ->hiddenLabel() ->grouped() ->options(DashboardPreset::options()), ToggleButtons::make('range') ->default(DashboardDateRange::Last30Days->value) ->hiddenLabel() ->grouped() ->options(DashboardDateRange::options()), ]); } public function getWidgets(): array { return $this->getWidgetsForPreset(DashboardPreset::fromFilter($this->filters['preset'] ?? null)); } protected function getWidgetsForPreset(DashboardPreset $preset): array { return match ($preset) { DashboardPreset::Revenue => $this->revenueWidgets(), DashboardPreset::Growth => $this->growthWidgets(), DashboardPreset::Operations => $this->operationsWidgets(), }; } protected function revenueWidgets(): array { return [ RevenuePulseWidget::class, RevenueByRegionWidget::class, FulfillmentRateWidget::class, RevenueGoalWidget::class, DailyRevenueWidget::class, ]; } // growthWidgets() and operationsWidgets() follow the same pattern}
The key points:
getColumns()DashboardPreset and DashboardDateRange are PHP enums that provide labels, options, and date calculationsThe RevenuePulseWidget shows four rows — Revenue, Orders, Avg Order Value, and Completion Rate — each with a current value, period-over-period comparison, and a daily sparkline chart. All data classes come from...