tobymaxham / laravel-datetime-scopes
A package to simply query your datasets.
v1.0
2022-02-20 22:58 UTC
Requires
- php: ^8.0
- illuminate/contracts: ^8.0 || ^9.0
- illuminate/database: ^8.0 || ^9.0
- illuminate/support: ^8.0 || ^9.0
README
Composer install package
composer require tobymaxham/laravel-datetime-scopes
Usage
use TobyMaxham\LaravelDateTimeScopes\DateTimeScopes; class Invoice extends Model { use DateTimeScopes; }
// samples.php Invoice::ofYesterday(); // query invoices created yesterday Invoice::ofLastWeek(); // query invoices created in the last week Invoice::ofLastMonth(); // query invoices created in the last month Invoice::ofLastQuarter(); // query invoices created in the last quarter Invoice::ofLastYear(); // query invoices created in the last year
Also there are the methods ofLastMinutes
and ofLastHour
you could use to fetch entries that are created in the last minute/hour.
Security Vulnerabilities
If you've found a bug regarding security please mail git@maxham.de instead of using the issue tracker.
Support me
Credits
License
The MIT License (MIT). Please see License File for more information.