This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.
You can install the package via composer:
composer require immera/analytics
After installing please setup your API key in the .env
file
ANALYTICS_SERIAL_KEY=
Analytics::store([
'action' => 'test',
'project' => 'analytics',
'price' => rand(0, 10000) / 100,
'quantity' => rand(0, 8),
])
$result = Analytics::query()
->match(['action' => 'test'])
->project(['action' => 1, 'project' => 1])
->limit(1)
->fetchJson();
$result = Analytics::query()
->match([
'action' => 'test',
'created_at.year' => 2022,
])
->group([
'_id' => [
'year' => '$created_at.year',
'month' => '$created_at.month',
'day' => '$created_at.day',
'hour' => '$created_at.hour',
],
'count' => [
'$sum' => 1,
],
])
->sort([
'_id.year' => -1,
'_id.month' => -1,
'_id.day' => -1,
'_id.hour' => -1,
])
->limit(100)
->fetchJson();
$result = Analytics::query()
->match([
'action' => 'test',
])
->group([
'_id' => [
'year' => '$created_at.year',
'month' => '$created_at.month',
],
'totalPrice' => [
'$sum' => '$price',
],
'averageQuantity' => [
'$avg' => '$quantity',
],
])
->sort([
'_id.year' => -1,
'_id.month' => -1,
])
->limit(100)
->fetchJson();
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.