jeffersongoncalves / filament-cookie-consent
This Filament package provides a simple and elegant way to implement cookie consent on your website, ensuring compliance with privacy regulations like GDPR and CCPA. It offers a clean and customizable interface, allowing you to easily manage and display cookie consent banners and preferences.
Requires
- php: ^8.2|^8.3
- filament/filament: ^4.0
- jeffersongoncalves/laravel-cookie-consent: ^1.0
- laravel/framework: ^11.0|^12.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- larastan/larastan: ^3.0
- orchestra/testbench: ^9.0|^10.0
README
Filament Cookie Consent
This Filament package provides a simple and elegant way to implement cookie consent on your website, ensuring compliance with privacy regulations like GDPR and CCPA. It offers a clean and customizable interface, allowing you to easily manage and display cookie consent banners and preferences.
Installation
You can install the package via composer:
composer require jeffersongoncalves/filament-cookie-consent
Usage
This package automatically integrates cookie consent functionality into your Filament panels. Once installed, the cookie consent banner will be automatically displayed on all Filament panel pages without any additional configuration.
Configuration
You can customize the cookie consent appearance and behavior by publishing the configuration file:
php artisan vendor:publish --tag=cookie-consent-config
This will publish the configuration file to config/cookie-consent.php
where you can customize:
- Message content: Customize the cookie consent message, button text, and privacy policy link
- Styling: Configure colors for the popup background, text, and button
- Position: Set the position of the cookie consent banner (bottom-left, bottom-right, top-left, top-right, etc.)
Example configuration:
return [ 'content' => [ 'message' => 'This website uses cookies and other tracking technologies...', 'dismiss' => 'Accept', 'link' => 'Privacy Policy', 'href' => '/privacy-policy', ], 'palette' => [ 'popup' => [ 'background' => '#696969', 'text' => '#FFFFFF', ], 'button' => [ 'background' => '#FFAB00', 'text' => '#FFFFFF', ], ], 'position' => 'bottom-left', ];
How it works
This package extends the jeffersongoncalves/laravel-cookie-consent package specifically for Filament panels. It automatically registers render hooks that inject the cookie consent templates into your Filament panel pages:
- Cookie consent scripts are automatically added to the
<head>
section - Cookie consent banner is automatically added to the end of the
<body>
section
No manual template inclusion is required when using this Filament package.
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.