tobymaxham/laravel-datetime-scopes

一个用于简单查询数据集的包。

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

This package is auto-updated.

Last update: 2024-09-18 18:33:42 UTC


README

Latest Version on Packagist Total Downloads

Composer 安装包

composer require tobymaxham/laravel-datetime-scopes

用法

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

此外,您还可以使用 ofLastMinutesofLastHour 方法来获取在过去一分钟/小时内创建的条目。

安全漏洞

如果您发现了关于安全性的错误,请通过邮箱 git@maxham.de 而不是使用问题跟踪器来报告。

支持我

ko-fi

致谢

许可证

MIT 许可证 (MIT)。更多信息请参阅 许可证文件