1. Go to this page and download the library: Download hms/statistics 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/ */
hms / statistics example snippets
use Hms\Statistics\Eloquents\Statistics;
use Jenssegers\Mongodb\Eloquent\Model;
class Example extends Model
{
use Statistics;
public function __construct()
{
parent::__construct();
$this->statisticsConditionFields = [
'day'
];
$this->incrementFields = [
'number'
];
}
}
use App\Example;
$example = new Example();
$example->statistics([
'day' => Carbon::now()->toDateString(),
'number' => 1
]);