### Install filament-cookie-consent via Composer Source: https://github.com/jeffersongoncalves/filament-cookie-consent/blob/3.x/README.md Install the package via Composer. Requires PHP 8.2+, Laravel 11.0+, and Filament 5.0. ```bash composer require jeffersongoncalves/filament-cookie-consent:^3.2 ``` -------------------------------- ### Run tests with composer test Source: https://github.com/jeffersongoncalves/filament-cookie-consent/blob/3.x/README.md Runs the test suite for the package using Composer. Execute this command from the project root to run all tests. ```bash composer test ``` -------------------------------- ### Publish and run cookie consent settings migration Source: https://github.com/jeffersongoncalves/filament-cookie-consent/blob/3.x/README.md Publish and run the cookie consent settings migration. Run after publishing the Spatie Laravel Settings migration. ```bash php artisan vendor:publish --tag=cookie-consent-settings-migrations php artisan migrate ``` -------------------------------- ### Publish Spatie Laravel Settings migration Source: https://github.com/jeffersongoncalves/filament-cookie-consent/blob/3.x/README.md Publish the Spatie Laravel Settings migration if not already published. This is a prerequisite for the cookie consent settings migration. ```bash php artisan vendor:publish --provider="Spatie\LaravelSettings\LaravelSettingsServiceProvider" --tag="migrations" ``` -------------------------------- ### Settings Page Form Schema Source: https://github.com/jeffersongoncalves/filament-cookie-consent/blob/3.x/resources/boost/skills/cookie-consent-development/SKILL.md Form components for the ManageCookieConsentSettings page, including asset URLs, content fields, color pickers, and layout selects. All fields are required unless noted. ```php // Assets section TextInput::make('css_url')->url()->required() TextInput::make('js_url')->url()->required() // Content section TextInput::make('content_header')->required() Textarea::make('content_message')->required()->columnSpanFull() TextInput::make('content_dismiss')->required() TextInput::make('content_allow')->required() TextInput::make('content_deny')->required() TextInput::make('content_link')->required() TextInput::make('content_href')->url()->nullable() Select::make('content_target')->options(['_blank', '_self'])->required() TextInput::make('content_close')->required() TextInput::make('content_policy')->required() // Color sections use ColorPicker components ColorPicker::make('popup_background')->required() // ... etc. // Layout section Select::make('position')->options(['top-left', 'top-right', 'bottom-left', 'bottom-right']) Select::make('theme')->options(['block', 'edgeless', 'classic']) ``` -------------------------------- ### Render Hook Registration in CookieConsentServiceProvider Source: https://github.com/jeffersongoncalves/filament-cookie-consent/blob/3.x/resources/boost/skills/cookie-consent-development/SKILL.md Registers render hooks in packageRegistered() to inject cookie consent views into the panel head and body. Uses FilamentView and PanelsRenderHook. ```php FilamentView::registerRenderHook( PanelsRenderHook::HEAD_START, fn (): View => view('cookie-consent::cookie-consent-head') ); FilamentView::registerRenderHook( PanelsRenderHook::BODY_END, fn (): View => view('cookie-consent::cookie-consent-body') ); ``` -------------------------------- ### Register CookieConsentPlugin in Filament Panel Provider Source: https://github.com/jeffersongoncalves/filament-cookie-consent/blob/3.x/README.md Registers the CookieConsentPlugin in a Filament panel provider. The plugin automatically adds cookie consent scripts to the and the banner to the end of the . ```php use JeffersonGoncalves\Filament\CookieConsent\CookieConsentPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ CookieConsentPlugin::make(), ]); } ``` -------------------------------- ### Disable Cookie Consent Settings Page Source: https://github.com/jeffersongoncalves/filament-cookie-consent/blob/3.x/README.md Disables the Cookie Consent Settings page while keeping the automatic cookie consent integration. Use this when you only want the banner without the settings UI. ```php CookieConsentPlugin::make() ->settingsPage(false), ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.