Last active
July 31, 2023 10:24
-
-
Save Sairahcaz/8ecb17c1384f1b1dc71f8b4a118d1718 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use LaracraftTech\LaravelDateScopes\DateScopes; | |
class Transaction extends Model | |
{ | |
use DateScopes; | |
} | |
// Usage | |
Transaction::ofLastMinute(); // query transactions created during the last minute | |
Transaction::ofLastHour(); // query transactions created during the last hour | |
Transaction::ofLast24Hours(); // query transactions created during the last 24 hours | |
Transaction::ofToday(); // query transactions created today | |
Transaction::ofLast7Days(); // query transactions created during the last 7 days | |
Transaction::ofLast30Days(); // query transactions created during the last 30 days | |
Transaction::ofLastWeek(); // query transactions created during the last week | |
Transaction::ofLastMonth(); // query transactions created during the last month | |
Transaction::ofLastQuarter(); // query transactions created during the last quarter | |
Transaction::ofLastYear(); // query transactions created during the last year | |
// ...and much more! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment