keizah7/custom-date-filter
A Laravel package that adds a configurable date filter to your admin panels, letting users narrow records by custom ranges, presets, or single dates. Simple to register, easy to style, and flexible enough for any resource.
Architecture fit
Laravel\Nova\Filters\Filter implementing apply(Request $request, $query, $value) plus an options()/UI component. A "custom date filter" is therefore one of the lowest-risk package categories in the Laravel ecosystem — it hooks the Nova index/lens query builder only.Nova::dateFilter() out of the box, and the davidhemphill/nova-date-filter-style packages are common. This package must justify itself against a two-line built-in.Integration feasibility
composer require keizah7/custom-date-filter, then add the class to a resource's filters() array. Expect a {start, end} or ['from' => ..., 'to' => ...] payload passed to apply().apply() use whereDate() or whereBetween() — the former defeats indexes on a datetime column.Technical risk
keizah7/custom-date-filter does not match the repository name nova-date-filter. For a 0-adoption package this is a supply-chain hygiene smell — verify the source URL in composer.json actually resolves to the GitHub repo you think it does before installing.Filter contract is stable-ish but the key/options/default semantics and Vue filter components shifted between Nova 3, 4, and 5. An unpinned or dev-only stability constraint means composer update can silently break admin filtering.whereDate against a UTC column with a non-UTC app timezone produces off-by-one-day results around midnight.Key questions
Nova::dateFilter() (Nova 4+) or a 40-line local filter does not?composer.json?dev-master?apply() use whereDate, whereBetween, or raw where — and how are partial/null ranges handled (exception vs. full table scan)?Stack fit
app/Nova/Filters/CustomDateFilter.php, attribute the source, and drop the Composer dependency. You retain the behavior, eliminate the maintenance and supply-chain exposure, and can fix the whereDate/timezone issues yourself.Migration path
filters().Compatibility
composer.json require constraints against your exact laravel/framework and laravel/nova versions before installing. Nova constraints are frequently the blocker.repositories/source URL matches the GitHub repo — see the name mismatch above.Sequencing
--prefer-dist and inspect the class.->toSql() / explain), specifically checking for index usage and day-boundary behavior at 00:00 and 23:59 in your app timezone.app/Nova/Filters/ (recommended) or pin the exact version with a lockfile.Maintenance
Support
Scaling
whereDate() on a datetime column forces a full scan on large tables; on a million-row Nova index this becomes a p95 latency problem that looks like "Nova is slow." Prefer half-open interval predicates (where('created_at', '>=', $start)->where('created_at', '<', $endExclusive)) so the index is usable.Failure modes
whereDate semantics produce off-by-one-day filtering that no one notices until a report disagrees with the UI.apply() receives an unexpected shape, and the query degrades to unfiltered — worse than an error, because it looks like it works.composer install on a clean checkout, breaking CI for unrelated PRs.source could pull different code than reviewed. Audit once, then vendor.Ramp-up
TPM recommendation: treat this as a ~90-minute source-reading and fork exercise, not a dependency decision. The architectural risk is negligible; the provenance and longevity risk is real but entirely avoidable at near-zero cost.
How can I help you explore Laravel packages today?