承接 mmoollllee/filament-consent-control 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

mmoollllee/filament-consent-control

Composer 安装命令:

composer require mmoollllee/filament-consent-control

包简介

Filament admin UI for consent-control: an opt-in settings page/form and a RichEditor plugin for embedding consent-gated iframes.

README 文档

README

The Filament admin layer for consent-control: an opt-in settings page/form and a RichEditor plugin for embedding consent-gated iframes.

Part of a three-package stack:

Package Role
consent-control (npm) Framework-agnostic runtime + CSS.
laravel-consent-control Blade components, config, drivers, translations, server helpers.
filament-consent-control (this package) Filament settings UI + RichEditor consent-iframe plugin.

The frontend banner, blocking and configuration come from laravel-consent-control (installed automatically). A single config file is enough — this package only adds optional admin convenience on top.

Requirements

  • PHP 8.2+ · Laravel 11.28+ / 12 · Filament 5

Installation

composer require mmoollllee/filament-consent-control

This pulls in laravel-consent-control. Publish its config and runtime assets, then set up the frontend as described in its README:

php artisan vendor:publish --tag=consent-control-config
php artisan vendor:publish --tag=consent-control-assets

Register the plugin in your panel (does nothing by itself unless you opt in below):

use Mmoollllee\FilamentConsentControl\ConsentControlPlugin;

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

Editing settings in Filament (opt-in)

By default settings are read from config/consent-control.php. To edit them at runtime, opt in to the eloquent driver and one of the two admin options below.

CONSENT_CONTROL_DRIVER=eloquent
// config/consent-control.php
'eloquent' => [
    'model' => App\Models\Setting::class,   // needs: $casts = ['consent_settings' => 'array']
    'field' => 'consent_settings',
    'record_id' => 1,
],

Option A — ready-made settings page

ConsentControlPlugin::make()->settingsPage();

Adds a "Consent Settings" page to the panel that reads/writes the configured model.

Option B — embed the form in your own resource/page

use Mmoollllee\FilamentConsentControl\Filament\ConsentSettingsForm;

public function form(Schema $schema): Schema
{
    return $schema->components([
        ConsentSettingsForm::make('consent_settings'),
        // ... your other fields
    ]);
}

RichEditor: embed consent-gated iframes

use Filament\Forms\Components\RichEditor;
use Mmoollllee\FilamentConsentControl\Filament\ConsentIframePlugin;

RichEditor::make('body')
    ->plugins([
        ConsentIframePlugin::make(),
    ]);

The toolbar gets an "Embed iframe" action (URL, consent category, width, height). Pasted YouTube/Vimeo links are auto-converted to privacy-friendly embed URLs (YouTube → nocookie). Stored iframes are rendered on the frontend as blocked .consent-message--wrapper markup (data-src) and only load once the visitor grants the chosen category — handled by the shared runtime, so make sure <x-consent-control-scripts /> is on the page.

License

MIT. See LICENSE.md.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固