1. Go to this page and download the library: Download beacon-hq/metrics 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/ */
beacon-hq / metrics example snippets
use Carbon\Carbon;
use Beacon\Metrics\Metrics;
$value = Metrics::query(MyModel::query())
->count()
->between(now()->subMonth(1), now())
->value(); // 123
use Carbon\Carbon;
use Beacon\Metrics\Metrics;
$value = Metrics::query(MyModel::query())
->count()
->groupBy('category')
->between(now()->subMonth(1), now())
->value(); // ['category1' => 123, 'category2' => 456]