jeffersongoncalves/laravel-cookie-consent
Simple Laravel cookie consent banner with GDPR/CCPA-friendly preferences. Drop-in head/body includes, optional view publishing for customization, and settings stored in the database via spatie/laravel-settings with helper access for runtime updates.
Drop Laravel 11 support (EOL, unpatched). Require laravel/framework: ^12.61.1|^13.12.0 to fix:
Breaking change: Laravel 11 is no longer supported.
Full Changelog: https://github.com/jeffersongoncalves/laravel-cookie-consent/compare/v3.0.2...v3.0.3
config/cookie-consent.php to database via spatie/laravel-settingsUpdate the package:
composer require jeffersongoncalves/laravel-cookie-consent:^2.0
Run migrations to create the settings in the database:
php artisan migrate
Delete your old config/cookie-consent.php file (no longer used).
If you had custom values in the config file, update them via code:
$settings = cookie_consent_settings();
$settings->position = 'top-right';
$settings->popup_background = '#000000';
$settings->save();
CookieConsentSettings with 15 typed properties for type-safe accesscookie_consent_settings() for convenient access in views and code--tag=cookie-consent-settings-migrations| Property | Type | Default |
|---|---|---|
css_url |
string |
CDN cookieconsent CSS |
js_url |
string |
CDN cookieconsent JS |
content_href |
?string |
null |
content_close |
string |
❌ |
popup_background |
string |
#696969 |
popup_text |
string |
#FFFFFF |
popup_link |
string |
#FFFFFF |
button_background |
string |
transparent |
button_border |
string |
#f8e71c |
button_text |
string |
#f8e71c |
highlight_background |
string |
#f8e71c |
highlight_border |
string |
#f8e71c |
highlight_text |
string |
#000000 |
position |
string |
bottom-left |
theme |
string |
block |
Full Changelog: https://github.com/jeffersongoncalves/laravel-cookie-consent/compare/v1.1.1...v2.0.0
Full Changelog: https://github.com/jeffersongoncalves/laravel-cookie-consent/compare/v1.1.1...v1.2.0
How can I help you explore Laravel packages today?