malzariey/filament-daterangepicker-filter
Alpine.js-powered date range picker and filter for Filament. Pick day/month/year ranges with presets, optional time selection (12/24h), keyboard input validation, localization, accessibility, and modal/slide-over friendly dropdown teleport. Matches Filament v4 UI.
Pros:
Table, Form).daterangepicker.js) without reinventing core logic.Cons:
daterangepicker.js (v3+), adding frontend complexity. May need bundling (Vite, Laravel Mix) or CDN inclusion.QueryBuilder).addFilter().daterangepicker.js (likely via npm/yarn or CDN). Ensure your Laravel app’s build pipeline (Vite/Webpack) can handle it.QueryBuilder must support the date range syntax generated by the filter (e.g., between, >=, <=). Test edge cases like null values or invalid ranges.| Risk Area | Severity | Mitigation |
|---|---|---|
| Filament Version Mismatch | High | Pin to a specific Filament version in composer.json or fork if needed. |
| JavaScript Conflicts | Medium | Isolate daterangepicker in a micro-frontend or namespace CSS/JS. |
| Poor Documentation | Medium | Test with a minimal Filament table; expect trial-and-error for edge cases. |
| Lack of Backend Validation | Low | Add server-side validation for date ranges if business logic requires it. |
| Performance with Large Data | Low | Benchmark with 10K+ records; Filament’s query builder may need optimization. |
daterangepicker integrate smoothly?DD/MM/YYYY)?DateFilter or third-party packages like spatie/laravel-filament-resources for similar functionality?daterangepicker.js or willing to adopt it for consistency.Prerequisites:
composer require malzariey/filament-daterangepicker-filter
daterangepicker.css/js in your layout or Vite config.Implementation Steps:
use Malzariey\FilamentDaterangepickerFilter\Filters\DateRangeFilter;
$table->filters([
DateRangeFilter::make('created_at')
->label('Creation Date'),
]);
2026-01-01 to 2026-01-01).Advanced Integration:
FilterGroup for complex queries.filament-spatie-laravel-medialibrary).composer.json for Laravel version constraints (likely 9.x/10.x). Use laravel-shift/doctrine or similar if on an older version.daterangepicker.js supports modern browsers. Test in your target environments (e.g., Safari, Firefox).Phase 1: Proof of Concept (1–2 days)
Phase 2: Core Implementation (3–5 days)
Phase 3: Optimization (1–2 days)
daterangepicker).Phase 4: Rollout
malzariey/filament-daterangepicker-filter and daterangepicker.js for security patches.filters() method syntax.daterangepicker is loaded and namespaced correctly.daterangepicker initialization.dd($table->getFilters()) to debug filter configuration.daterangepicker is lightweight (~50KB minified). No significant impact on page load.How can I help you explore Laravel packages today?