DEV Community

Martin Schenk
Martin Schenk

Posted on

✅ Laravel Cookie Consent – Plug & play GDPR/DSGVO modal

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.