laracraft-tech/laravel-date-scopes
Add a DateScopes trait to Eloquent models to query records by common date ranges: today, last week, month-to-date, last year (with custom start), and more. Chain scopes with aggregates like sum/avg for fast stats-friendly queries.
whereBetween() queries across models (e.g., created_at BETWEEN ...) with reusable, consistent scopes.event_timestamp instead of created_at) and requires custom logic (e.g., timezone offsets).date_trunc) that handles time ranges natively.*"This package cuts development time for time-based queries by 80%. For example, instead of writing custom SQL to fetch ‘last month’s orders’ (a task that takes 1–2 hours per endpoint), our team can use Order::ofLastMonth()—a single line of code. This directly impacts:
*"This is a batteries-included solution for Eloquent date queries. Key benefits:
Carbon logic.BETWEEN clauses under the hood.DateScopes trait to any model, then chain scopes like User::ofLast7Days()->count() or Invoice::monthToDate()->sum('amount').*
Tradeoff: Minimal learning curve if you’re already using Eloquent, but requires adopting a trait-based pattern."*How can I help you explore Laravel packages today?