Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Cookie Consent Laravel Package

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.

View on GitHub
Deep Wiki
Context7
v2.1

πŸ”” v2.1 – Asset Flexibility & Architecture Improvement

This release introduces custom asset URL support and refactors the internal asset resolution logic for better stability and maintainability.


βœ… What’s New

  • Added asset_url configuration option for custom asset hosting or CDN support.
  • Assets now optionally resolve through a custom base URL.
  • Clean fallback to Laravel’s native asset() helper when no custom URL is configured.

βœ… What Improved

  • Removed fragile environment detection logic from asset resolution.

  • Removed unnecessary system processing directory dependency.

  • Improved compatibility with:

    • Laravel Sail
    • Laravel Octane
    • Docker
    • Windows
    • Shared hosting
    • Production environments

πŸš€ Upgrade Guide

1️⃣ Update the Package

composer update devrabiul/laravel-cookie-consent

2️⃣ Publish Updated Package Resources

After updating, publish the latest resources:

php artisan vendor:publish --provider="Devrabiul\CookieConsent\CookieConsentServiceProvider"

3️⃣ (Recommended) Remove Old Config File

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.


4️⃣ Add Custom Asset URL (Optional)

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

⭐ Special thanks to contributors and users who reported asset resolution issues and helped improve compatibility across environments.

v2.0

v2.0 – 🎨 Theme Presets & Dark Mode Enhancements

✨ New Features

  • Added theme presets: basic, modern-blue, trust-green, soft-neutral, and dark
  • Dark Mode & Auto Mode improvements with full color contrast updates

✨ Fixed

  • CSS & JS assets now load correctly on Nginx servers

πŸš€ Improvements

  • Improved asset path handling for all hosting environments
  • Updated colors and styles for banners, modals, and toggle switches
  • Enhanced banner readability and accessibility
  • Fully responsive design for mobile, tablet, and desktop
  • RTL language support maintained
  • Preferences modal interaction refined

πŸ“¦ Upgrade Notes

  • Update config/cookie-consent.php to include 'theme_preset' => env('COOKIE_CONSENT_THEME_PRESET', 'basic')
  • Dark mode can now be toggled using theme="dark" or color_mode="auto"

Get Started with v2.0:

composer update devrabiul/laravel-cookie-consent
v1.1

πŸ“¦ v1.1.0 – Preference Modal Access + Nginx Asset Fix

✨ New Features

  • πŸ” 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.


πŸ› οΈ Fixes & Improvements

  • Nginx Asset Loading Fix Resolved issues where cookie banner assets weren’t being loaded properly in some Nginx setups.

    • Assets now reference correct public paths and respect Laravel's asset helper behavior.

πŸ“₯ How to Upgrade

Update the package using Composer:

composer update devrabiul/laravel-cookie-consent

Re-publish assets if needed:

php artisan vendor:publish --provider="Devrabiul\CookieConsent\CookieConsentServiceProvider"

πŸ”„ Final Steps

Clear your config cache to apply changes:

php artisan config:clear
v1.0.2

πŸ“¦ v1.0.2 – Custom Translations Flow Added

Release Date: April 23, 2025


πŸ› οΈ Enhancements & Fixes

  • Custom Translation Flow
    Introduced a more streamlined and flexible system for managing translations.
    • All translatable strings can now be fully customized through your own language files.
    • This improvement enhances localization support, making it easier to adapt the cookie consent UI for multilingual websites.

πŸ“₯ How to Upgrade

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.php file before publishing the updated version.


πŸ”„ Final Steps

Clear your cached configuration to ensure changes take effect:

php artisan config:clear
v1.0.1

πŸ“¦ v1.0.1 – Bug Fix Release

Released on: April 16, 2025


πŸ› Fixed

  • Cookie Categories Visibility Issue #1
    Fixed an issue where enabling or disabling cookie categories via the 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.
    • All cookie categories were previously shown regardless of the configuration.
    • Now, only the categories explicitly enabled in the config or passed to the JS options will be displayed.

Special thanks to [@peterbormans](https://github.com/peterbormans) for reporting this issue πŸ™


πŸ“₯ How to Update

If you're using Composer:

composer update devrabiul/laravel-cookie-consent

Or to update just this package:

composer require devrabiul/laravel-cookie-consent

πŸ“Œ Notes

  • Clear any cached config if needed:
php artisan config:clear
v1.0.0

Laravel Cookie Consent

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.

Features

  • πŸ”₯ One-Click Implementation – Simple installation via Composer with auto-loaded assets
  • ⚑ Zero Performance Impact – Lightweight with lazy-loaded components
  • 🌍 RTL & i18n Support – Full right-to-left compatibility + multilingual translations
  • πŸŒ™ Dark Mode Support – Auto dark/light mode matching system preferences
  • πŸ›‘ Granular Consent Control – Category-level cookie management (necessary/analytics/marketing)
  • πŸ“¦ Complete Customization – Override every color, text, and layout via config
  • πŸ“± Responsive Design – Perfectly adapts to all devices (mobile/tablet/desktop)

laravel-cookie-consent

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4