- Install module:
composer require yajra/analytics-module
- Publish config:
php artisan vendor:publish --provider="Spatie\Analytics\AnalyticsServiceProvider"
- Update
.env
and add yourANALYTICS_VIEW_ID
- Copy and paste your google service account credentials on
storage/app/analytics/service-account-credentials.json
- Fetch all widgets data via ajax request.
- Convert period of each widgets to ajax parameters.
- Add total stats along with the graph.
This module uses laravel-analytics package.