by Danilo Polani
Add a fancy Plausible statistics widget to your Filament admin dashboard.
You can install the package via composer:
composer require danilopolani/filament-plausible-widget
Then publish the assets of the package:
php artisan vendor:publish --tag=filament-plausible-widget-assets
If you're upgrading from v1 to v2 please note that the namespace changed from
\Danilopolani\
to\DaniloPolani\
.
When upgrading, you may want to republish the assets:
php artisan vendor:publish --tag=filament-plausible-widget-assets --force
You need only two env variables to display your Plausible widget:
Env | Description |
---|---|
FILAMENT_PLAUSIBLE_TOKEN |
Your Plausible API key. Read more » |
FILAMENT_PLAUSIBLE_SITE_ID |
The site ID you want to get statistics of. Read more » |
If you want to go deeper you can publish the configuration file:
php artisan vendor:publish --tag=filament-plausible-widget-config
There are a few notable configuration options for the package.
Your Plausible API key. You can obtain an API key for your account by going to your user settings page https://plausible.io/settings.
The site ID you want to get statistics of. You can obtain this value by navigating to your site settings in Plausible and grab the "value" of the domain field. E.g. plausible.io/mysite.com
becomes mysite.com
.
The period shown by default in the dashboard. Can be any of these values: day
, 7d
, 30d
, month
, 6mo
, 12mo
. Default: 7d
.
Choose if let users select a different period of statistics in the dashboard. Default: true
.
(Recommended) Cache the statistics to avoid API calls for a specific amount of time. Default: true
.
If cache is enabled, define for how long the statistics are stored in the cache.