devrabiul/laravel-cookie-consent
GDPR-compliant cookie consent for Laravel with one-click install. Lightweight, no frontend deps, responsive banner with dark mode, RTL/i18n, and granular category controls (necessary/analytics/marketing). Fully customizable colors, text, and layout via config.
This release introduces custom asset URL support and refactors the internal asset resolution logic for better stability and maintainability.
asset_url configuration option for custom asset hosting or CDN support.asset() helper when no custom URL is configured.Removed fragile environment detection logic from asset resolution.
Removed unnecessary system processing directory dependency.
Improved compatibility with:
composer update devrabiul/laravel-cookie-consent
After updating, publish the latest resources:
php artisan vendor:publish --provider="Devrabiul\CookieConsent\CookieConsentServiceProvider"
To avoid conflicts with the new version:
Delete:
config/laravel-cookie-consent.php
Then re-publish the configuration file to ensure you get the latest structure.
If you want to use CDN or custom asset hosting, add this to your .env:
COOKIE_CONSENT_ASSET_URL=https://your-domain.com
If not set, the package will automatically use Laravel's native asset() helper.
β Special thanks to contributors and users who reported asset resolution issues and helped improve compatibility across environments.
β¨ New Features
basic, modern-blue, trust-green, soft-neutral, and dark⨠Fixed
π Improvements
π¦ Upgrade Notes
config/cookie-consent.php to include 'theme_preset' => env('COOKIE_CONSENT_THEME_PRESET', 'basic')theme="dark" or color_mode="auto"Get Started with v2.0:
composer update devrabiul/laravel-cookie-consent
π Cookie Preferences Reopen Support In compliance with UK ICO and GDPR regulations, users can now revisit and change their cookie preferences at any time.
Add a link anywhere in your app to reopen the preferences modal:
<a onclick="showHideToggleCookiePreferencesModal()">Change Cookie Preferences</a>
or
<a class="showHideToggleCookiePreferencesModal">Change Cookie Preferences</a>
Adds support for both inline onclick and class-based toggling (no extra JS needed).
Triggers the same modal UI shown on first visit.
Nginx Asset Loading Fix Resolved issues where cookie banner assets werenβt being loaded properly in some Nginx setups.
Update the package using Composer:
composer update devrabiul/laravel-cookie-consent
Re-publish assets if needed:
php artisan vendor:publish --provider="Devrabiul\CookieConsent\CookieConsentServiceProvider"
Clear your config cache to apply changes:
php artisan config:clear
Release Date: April 23, 2025
To update the package, run the following command:
composer update devrabiul/laravel-cookie-consent
After updating, re-publish the configuration file:
php artisan vendor:publish --provider="Devrabiul\CookieConsent\CookieConsentServiceProvider"
β οΈ Important: Delete the existing
config/laravel-cookie-consent.phpfile before publishing the updated version.
Clear your cached configuration to ensure changes take effect:
php artisan config:clear
Released on: April 16, 2025
laravel-cookie-consent.php config file or through the JavaScript options array had no effect on which cookie categories were shown in the cookie preferences box.
Special thanks to [@peterbormans](https://github.com/peterbormans) for reporting this issue π
If you're using Composer:
composer update devrabiul/laravel-cookie-consent
Or to update just this package:
composer require devrabiul/laravel-cookie-consent
php artisan config:clear
A GDPR-compliant solution offering enterprise-grade compliance with fully customizable cookie banners for Laravel applications. Simplifies regulatory requirements while maintaining excellent user experience and complete customization capabilities.

How can I help you explore Laravel packages today?