PHP code example of timothepearce / laravel-quasar

1. Go to this page and download the library: Download timothepearce/laravel-quasar 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/ */

    

timothepearce / laravel-quasar example snippets


use App\Models\Projections\MyProjection;
use TimothePearce\TimeSeries\Projectable;

class MyProjectableModel extends Model
{
    use Projectable;

    protected array $projections = [
        MyProjection::class,
    ];
}

MyProjection::period('1 day')
    ->between(
        today()->subDay(), // start date
        today(), // end date
    )
    ->get();

MyProjection::period('1 day')
    ->toTimeSeries(
        today()->subDay(),
        today(),
    );
bash
php artisan migrate
bash
php artisan make:projection MyProjection