tobymaxham/laravel-datetime-scopes

A package to simply query your datasets.

v1.0 2022-02-20 22:58 UTC

This package is auto-updated.

Last update: 2024-10-18 18:38:26 UTC


README

Latest Version on Packagist Total Downloads

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

ko-fi

Credits

License

The MIT License (MIT). Please see License File for more information.