Skip to content

TobyMaxham/laravel-datetime-scopes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TobyMaxham Laravel DateTime Scopes

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages