A Laravel package that adds a simple, customizable cookie consent banner to comply with EU cookie law.
Spatie Laravel Cookie Consent is a Laravel package that adds a customizable cookie consent banner to websites, helping them comply with EU cookie law. It displays a banner informing users about cookies, records their consent, and prevents the banner from reappearing once consent is given. The package is designed for simplicity and ease of integration into Laravel applications.
Laravel developers who need a straightforward, customizable solution for adding cookie consent banners to comply with EU regulations. It's best for projects that require basic consent functionality without advanced features like category-based consent or automatic cookie blocking.
Developers choose this package for its simplicity, seamless Laravel integration, and full customization control over texts and views. It provides a lightweight, maintainable alternative to more complex cookie consent solutions, with clear documentation and support from the Spatie ecosystem.
Make your Laravel app comply with the crazy EU cookie law
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Easily include the banner in Blade templates with @include or use middleware for automatic injection, as documented in the README for seamless setup.
Publish translation files to modify messages and button labels, and override view files for complete HTML and JavaScript control, allowing tailored consent dialogs.
Adjust cookie name and lifetime via a published config file, providing flexibility in how consent is stored and managed across sessions.
Default styling uses TailwindCSS v2, with CSS examples provided for fixed or floating banner positioning, making it easy to match your site's design.
The package only includes an 'Allow' button, which the README admits might not meet legal requirements in some jurisdictions that mandate an explicit decline option.
It does not automatically block cookies or trackers before consent; developers must implement this manually, adding complexity for compliance.
Missing features for different consent categories, limiting its use for advanced compliance needs like GDPR's granular consent, as noted in the README.