c6digital / filament-plausible-page
Embed your Plausible dashboard inside of Filament.
Fund package maintenance!
c6digital
Requires
- php: ^8.1
- filament/filament: ^3.0
- illuminate/contracts: ^11.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^8.1
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^9.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-12-16 12:28:22 UTC
README
This package allows you to embed your Plausible Analytics dashboard as a page inside of Filament.
Installation
You can install the package via Composer:
composer require c6digital/filament-plausible-page
Usage
Register the plugin with Filament.
use C6Digital\FilamentPlausiblePage\FilamentPlausiblePagePlugin; public function panel(Panel $panel): Panel { return $panel ->plugin(FilamentPlausiblePagePlugin::make()); }
Provide a "Share URL" generated by Plausible in your .env
file.
PLAUSIBLE_SHARE_URL="https://plausible.io/share/mysite.com?auth=blahblahblah
Load your panel and view your analytics!
Disabling Plausible footer text
Use the hideFooterMark()
method to remove the "Stats powered by Plausible Analytics" footer mark.
return $panel ->plugin( FilamentPlausiblePagePlugin::make() ->hideFooterMark() );
Hide "Plausible" page title
Use the hidePageTitle()
method to hide the page title.
return $panel ->plugin( FilamentPlausiblePagePlugin::make() ->hidePageTitle() );
Conditionally registering navigation items
If you want to conditionally show the navigation items registered by the page, you can provide a callback function to the shouldRegisterNavigationUsing()
method.
FilamentPlausiblePagePlugin::make() ->shouldRegisterNavigationUsing(function () { return Tenant::hasPlausibleShareUrl(); });
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.