Are you struggling to make your Laravel app GDPR-compliant without compromising user experience? Say hello to Laravel Cookie Consent β a powerful, fully customizable cookie consent solution designed specifically for Laravel applications.
π GitHub Repository
π Documentation
β Why Use Laravel Cookie Consent?
Managing cookie consent can be tedious, but Laravel Cookie Consent makes it effortless with:
π₯ One-Click Implementation β Just install via Composer and you're ready to go!
β‘ Zero Performance Impact β Optimized for speed, with lazy-loaded assets.
π RTL & i18n Support β Supports multilingual sites and RTL layouts.
π Dark Mode Support β Adapts automatically to system preferences.
π‘ Granular Consent Control β Users can accept/reject cookies by category.
π¦ Complete Customization β Customize UI, text, and styles to match your brand.
π± Fully Responsive β Works flawlessly on desktop, tablet, and mobile.
π Installation in Seconds
Get started in 3 simple steps:
1οΈβ£ Install via Composer
composer require devrabiul/laravel-cookie-consent
2οΈβ£ Add the styles to your <head>
{!! CookieConsent::styles() !!}
3οΈβ£ Add the scripts before </body>
{!! CookieConsent::scripts() !!}
π‘ Thatβs it! Laravel Cookie Consent will now handle cookie management in your app!
π¨ Customize Everything
Out of the box, Laravel Cookie Consent provides multiple layout options, including:
β
Modal Styles: box
, box-inline
, cloud
, bar
, bar-inline
β
Preferences Modal: bar
, box
π‘ Need more control? Edit config/cookie-consent.php
to modify:
- Cookie lifetimes
- Text and button labels
- Consent categories (analytics, marketing, preferences, etc.)
- UI styles and theme settings
π Advanced Features
For developers who need enterprise-grade compliance, Laravel Cookie Consent includes:
β Cookie Expiry Configuration β Customize lifetime for accepted/rejected cookies.
β Disable Page Interaction β Block access until consent is given.
β Policy Links β Easily add links to your Privacy Policy and Terms & Conditions.
Example configuration:
{!! CookieConsent::scripts(options: [
'cookie_lifetime' => 7,
'reject_lifetime' => 1,
'disable_page_interaction' => true,
'preferences_modal_enabled' => true
]) !!}
π‘ Join the Community
Laravel Cookie Consent is open-source and constantly improving. Developers are welcome to contribute, suggest features, and help build a better Laravel ecosystem.
π GitHub Repository β Star it if you like it! β
π Packagist Page
π’ Final Thoughts
Whether you're building a startup or maintaining a large-scale Laravel project, cookie compliance shouldn't be a hassle. Laravel Cookie Consent ensures GDPR compliance while keeping UX intact.
π» Try it now and make your Laravel site privacy-friendly in minutes!
Got questions or feedback? Drop a comment below or reach out at Send Mail. π
Top comments (0)