tobymaxham / laravel-datetime-scopes
一个用于简单查询数据集的包。
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 安装包
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
此外,您还可以使用 ofLastMinutes
和 ofLastHour
方法来获取在过去一分钟/小时内创建的条目。
安全漏洞
如果您发现了关于安全性的错误,请通过邮箱 git@maxham.de 而不是使用问题跟踪器来报告。
支持我
致谢
许可证
MIT 许可证 (MIT)。更多信息请参阅 许可证文件。