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.

Installs: 941

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 1

Forks: 1

Open Issues: 0

pkg:composer/jeffersongoncalves/filament-cookie-consent

v3.0.0 2025-12-27 19:06 UTC

README

Filament Cookie Consent

Filament Cookie Consent

Latest Version on Packagist GitHub Code Style Action Status Total Downloads

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.

Compatibility

Package Version Filament Version
1.x 3.x
2.x 4.x
3.x 5.x

Features

  • 🚀 Automatic Integration: No need to manually add blade templates - works out of the box with Filament
  • 🎨 Clean & Customizable: Elegant interface that matches your Filament theme
  • ⚖️ GDPR & CCPA Compliant: Ensures your application meets privacy regulation requirements
  • 🔧 Highly Configurable: Extensive configuration options for customization
  • 📱 Responsive Design: Works perfectly on desktop and mobile devices
  • 🌐 Multi-language Support: Easily translatable for international applications

Requirements

  • PHP 8.2 or higher
  • Laravel 11.0 or higher
  • Filament 4.0

Installation

You can install the package via composer:

composer require jeffersongoncalves/filament-cookie-consent:^2.0

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

To customize the appearance and behavior of the cookie consent banner, you should first publish the configuration file:

php artisan vendor:publish --tag=cookie-consent-config

Then, you can customize the configuration in the config/cookie-consent.php file.

return [
    'css' => 'https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css',
    'js' => 'https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js',
    'content' => [
        'href' => null,
        'close' => '❌',
    ],
    'palette' => [
        'popup' => [
            'background' => '#696969',
            'text' => '#FFFFFF',
            'link' => '#FFFFFF',
        ],
        'button' => [
            'background' => 'transparent',
            'border' => '#f8e71c',
            'text' => '#f8e71c',
        ],
        'highlight' => [
            'background' => '#f8e71c',
            'border' => '#f8e71c',
            'text' => '#000000',
        ],
    ],
    'position' => 'bottom-left', // top-left, top-right, bottom-left, bottom-right
    'theme' => 'block', // block, edgeless, classic
];

Screenshots

Screenshots using this package in the admin panel provider.

Top Left Top Right
Top Left Top Right
Bottom Left Bottom Right
Bottom Left Bottom Right

Admin Panel Provider

To use this package, you need to register the CookieConsentServiceProvider in your composer.json (automatically done via Laravel package discovery) and ensure it's available for your Filament panels.

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.

The integration is automatically handled by the CookieConsentServiceProvider, which registers the necessary assets for all Filament panels.

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.