<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
the-3labs-team / nova-google-analytics-cards example snippets
use The3LabsTeam\NovaGoogleAnalyticsCards\Counter\ActiveUsersCounter;use The3LabsTeam\NovaGoogleAnalyticsCards\Counter\NewUsersCounter;use The3LabsTeam\NovaGoogleAnalyticsCards\Counter\PageViewsCounter;use The3LabsTeam\NovaGoogleAnalyticsCards\LineChart\PageViewLineChart;
...
(new ActiveUsersCounter())
(new NewUsersCounter())
(new PageViewsCounter())
(new PageViewLineChart())
use The3LabsTeam\NovaGoogleAnalyticsCards\Counter\ActiveUsersCounter;
...
(new ActiveUsersCounter(name: 'The name of the card (string)'))
/**
* Return the page path for Google Analytics
*/
public function getGaPagePathAttribute(): string
{
return str_replace(config('app.url'), '', $this->route);
}
public function cards(NovaRequest $request)
{
return [
(new PageViewLineChart(articleId: $request->resourceId))->width('1/2 ')
->onlyOnDetail()
->height('dynamic'),
(new RefClickPartition(articleId: $request->resourceId))->width('1/3')
->onlyOnDetail()
->height('dynamic'),
];
}
bash
php artisan vendor:publish
bash
php artisan vendor:publish
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.