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

spatie/laravel-cookie-consent

Add a simple, customizable cookie consent banner to Laravel. Shows on first visit, stores consent, then stays hidden. No “decline” option, no tracker blocking, and no consent categories—use other tools if you need advanced compliance features.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Compliance with GDPR/CCPA/EU Cookie Laws: Enables quick, cost-effective adherence to cookie consent requirements for EU/US-based users, reducing legal risk.
  • Roadmap for Privacy-First Features: Foundational step for future privacy controls (e.g., granular cookie categories, analytics opt-outs).
  • Build vs. Buy: Avoids reinventing the wheel for a compliance feature, leveraging a battle-tested, open-source solution with 1.5K+ stars.
  • Use Cases:
    • B2C Websites: Mandatory for EU-facing sites (e.g., e-commerce, SaaS).
    • Marketing/Analytics: Required for tools like Google Analytics, Facebook Pixel, or Matomo.
    • Multi-Region Apps: Supports localization (30+ languages) for global audiences.
    • Legacy System Modernization: Quick fix for older Laravel apps lacking compliance features.

When to Consider This Package

Adopt if:

  • Your Laravel app targets EU/US markets and requires cookie consent banners.
  • You need a simple, lightweight solution (no "Decline" option or advanced categories).
  • Your team lacks frontend expertise to build a custom banner (uses TailwindCSS by default).
  • You’re using Laravel 9–13 and PHP 8.0+ (check compatibility).

Look elsewhere if:

  • You need granular consent categories (e.g., "Necessary," "Marketing," "Analytics") → Consider whitecube/laravel-cookie-consent.
  • You require automatic cookie blocking before consent (this package only shows a banner).
  • Your app uses Filament admin panels → Use marcogermani87/filament-cookie-consent.
  • You’re on Laravel <9 or PHP <8.0 (unsupported).
  • Legal requirements mandate explicit decline options (this package only offers "Allow").

How to Pitch It (Stakeholders)

For Executives: *"This package solves a critical GDPR/CCPA compliance gap with minimal effort. For ~$0 (MIT license), we get a pre-built, localized cookie consent banner that:

  • Reduces legal risk by ensuring EU/US compliance.
  • Saves dev time (2 hours vs. weeks to build custom).
  • Scales globally with 30+ language supports.
  • Integrates seamlessly with our Laravel stack. Recommend adopting it as part of our Q3 privacy roadmap to avoid fines and align with user trust initiatives."*

For Engineering: *"Spatie’s laravel-cookie-consent is a lightweight, middleware-driven solution that:

  • Auto-injects a banner via Blade or middleware (no manual JS/CSS).
  • Supports TailwindCSS (aligns with our design system) or custom styling.
  • Localization-ready: Publish translations in 1 command.
  • Minimal overhead: 1 Composer install, 1 Blade include, or 1 middleware line. Tradeoff: No ‘Decline’ option or cookie blocking—we’d need to handle those separately if required. Alternatives like whitecube/laravel-cookie-consent offer more features but at higher complexity. Proposal: Use this for MVP compliance, then extend later if needed."*
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.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony