1. Go to this page and download the library: Download andreaselia/analytics 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/ */
use AndreasElia\Analytics\Models\PageView;
public function boot()
{
PageView::resolveTimezoneUsing(function () {
return request()->user()?->timezone;
});
}
protected function dashboards(): array
{
return [
new \AndreasElia\Analytics\Nova\Dashboards\Analytics,
];
}
protected function cards(): array
{
return [
new \AndreasElia\Analytics\Nova\Metrics\Devices,
new \AndreasElia\Analytics\Nova\Metrics\PageViews,
new \AndreasElia\Analytics\Nova\Metrics\UniqueUsers,
];
}