Laravel Simplestats
Simple statistics package for Laravel inspired by Simplestats for Kohana., (*1)
Requirements
Installation
Install the package via composer:, (*2)
composer require czemu/laravel-simplestats
If you're using Laravel >= 5.5, the package will register itself automatically., (*3)
Publish the migrations:, (*4)
php artisan vendor:publish --provider='Czemu\Simplestats\SimplestatsServiceProvider' --tag="migrations"
Run the migrations:, (*5)
php artisan migrate
You can also publish the config file:, (*6)
php artisan vendor:publish --provider='Czemu\Simplestats\SimplestatsServiceProvider' --tag="config"
Usage
Update or create statistics for an item named "file" with id "1":, (*7)
Simplestats::update('file', 1);
Update or create unique statistics (based on cookie) for an item named "print" with id "2":, (*8)
Simplestats::update('print', 2, TRUE);
Get statistics for an item named "page" with id "3":, (*9)
Simplestats::get('page', 3);
Get statistics for an item named "download" with id "4" on specified date:, (*10)
Simplestats::get('download', 4, '2018-05-20');
Get statistics for an item named "click" with id "5" between specified date range:, (*11)
Simplestats::get('download', 5, ['2018-05-01', '2018-05-15']);
License
The MIT License (MIT). Please see the LICENSE.md file for more information., (*12)