DEV Community

Martin Schenk
Martin Schenk

Posted on

βœ… Laravel Cookie Consent – Plug & play GDPR/DSGVO modal

Image description

Hey folks! πŸ‘‹
I just released a lightweight, developer-friendly cookie consent plugin for Laravel 11+ projects. It’s focused on real GDPR/DSGVO compliance – with a configurable modal, full Alpine.js support, language preferences, and real-time cookie blocking.

πŸ”Ή Easy to install
πŸ”Ή No frontend lock-in (customizable view & JS logic)
πŸ”Ή Works with Tailwind or plain CSS
πŸ”Ή Built for modern Laravel stacks

Check it out here:
πŸ‘‰ https://github.com/martinschenk/laravel-cookie-consent

Feedback, stars ⭐️ and contributions are very welcome! πŸ™

Top comments (1)

Collapse
 
falk_maria_zeitsprung profile image
Martin Schenk

For developers building apps in (or for) the EU:
πŸ›‘ You legally must not set any non-essential cookies before explicit user consent.
This includes analytics, ads (like Google Ads), YouTube embeds, etc.

Also:
Even cookies used by your application (like for language preferences or UI settings) must not be set unless consent is already given – unless they’re strictly necessary.

πŸ’‘ That’s exactly why I built this Laravel plugin.
It handles all of this out of the box:
β€’ No cookies are set too early
β€’ Full modal-based consent flow
β€’ Users can reopen the modal anytime to update preferences
β€’ Revoking consent automatically blocks & removes cookies again (like Google Ads)
β€’ Works great with Alpine.js & Tailwind – or plain setups
β€’ Super easy to install & customize

Check it out:
πŸ‘‰ github.com/martinschenk/laravel-co...

Hope it saves you a ton of time β€” and legal headaches.