PHP code example of tobymaxham / laravel-datetime-scopes
1. Go to this page and download the library: Download tobymaxham/laravel-datetime-scopes library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tobymaxham / laravel-datetime-scopes example snippets
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