jeffersongoncalves/filament-cookie-consent 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jeffersongoncalves/filament-cookie-consent

Composer 安装命令:

composer require 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.

README 文档

README

Filament Cookie Consent

Filament Cookie Consent

Latest Version on Packagist GitHub Code Style Action Status Total Downloads License

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 includes a Settings Page to manage all cookie consent options directly from your Filament panel.

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
  • Settings Page: Manage all cookie consent settings directly from your Filament panel
  • Database-driven Settings: Uses spatie/laravel-settings for persistent, database-backed configuration
  • GDPR & CCPA Compliant: Ensures your application meets privacy regulation requirements
  • Highly Configurable: Customize colors, position, theme, and content via the admin panel
  • 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 5.0

Installation

You can install the package via composer:

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

If you haven't already, publish the Spatie Laravel Settings migration:

php artisan vendor:publish --provider="Spatie\LaravelSettings\LaravelSettingsServiceProvider" --tag="migrations"

Then publish and run the cookie consent settings migration:

php artisan vendor:publish --tag=cookie-consent-settings-migrations
php artisan migrate

Plugin Registration

Register the plugin in your Filament Panel Provider:

use JeffersonGoncalves\Filament\CookieConsent\CookieConsentPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            CookieConsentPlugin::make(),
        ]);
}

Settings Page

Once registered, the plugin adds a Cookie Consent Settings page to your Filament panel under the "Settings" navigation group. From there you can configure:

  • Assets: CSS and JavaScript URLs for the cookie consent library
  • Content: Header, message, button texts, privacy policy URL, link target, and cookie policy text
  • Popup Colors: Background, text, and link colors
  • Button Colors: Background, border, and text colors
  • Highlight Colors: Background, border, and text colors
  • Layout: Banner position and theme

Disabling the Settings Page

If you only want the automatic cookie consent integration without the settings page:

CookieConsentPlugin::make()
    ->settingsPage(false),

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.

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

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.

统计信息

  • 总下载量: 9.26k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 27
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-09-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固