laravel-datetime-scopes maintained by tobymaxham
Description
A package to simply query your datasets.
Author
Last update
2022/02/20 23:58
(dev-main)
License
Downloads
8
Tags
TobyMaxham Laravel DateTime Scopes
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.