- How do I install laravel-cookie-consent in a Laravel app?
- Install it with Composer using composer require christopheraseidl/laravel-cookie-consent, then follow the README to publish the configuration and frontend assets. The package is intended to be included as a Livewire component in your Blade layout. Check the current README for exact publish tags and component names because v1.1.0 changed some paths.
- Does this package work with Livewire and Tailwind CSS?
- Yes. It is built around Livewire, Alpine.js, and Tailwind CSS and is aimed at Laravel apps using Blade and Livewire frontends. If you use an API-only, SPA-first, or non-Livewire stack, expect to do custom integration work.
- Which Laravel, PHP, and Livewire versions are supported?
- The package defines its supported Laravel, PHP, and Livewire ranges in Composer constraints, so check those before installing. The available assessment does not list exact versions and warns about compatibility gaps across Laravel, Livewire, and PHP. Confirm the constraints against your application's composer.json and the package README.
- How do I configure the cookie consent banner and cookie policy?
- Publish the package config file and adjust the banner, cookie policy, and consent settings there. v1.1.0 introduces a new config file, so existing installs should republish or merge it carefully. Review custom view overrides after every upgrade.
- Can I conditionally load scripts or cookies until consent is given?
- The package is designed for consent workflows where cookies or scripts should wait until permission is granted. The exact hook points depend on your published config, views, and component integration, so test each script tag. Do not assume automatic blocking of every third-party script without verifying.
- How do I upgrade from v1.0.x to v1.1.0?
- Upgrade in a staging branch and pin v1.1.0 before changing production. Read the changelog, diff removed and changed files against your customizations, republish or merge the new config, republish assets if needed, update old Livewire component references, and run regression tests. Keep a rollback to v1.0.x until staging sign-off.
- What breaking changes are in v1.1.0?
- v1.1.0 changes Livewire component paths, removes some files, adds a new config file, and explicitly warns that custom implementations may need updates. Removed-file replacements may be undocumented, so inventory any package files you extended or referenced. Treat these changes as breaking for extenders and test published views, components, and config overrides.
- Is laravel-cookie-consent suitable for GDPR or CCPA compliance?
- It provides a consent notice UI and workflows for recording choices and conditionally loading scripts, but it is not a legal compliance guarantee. You still need to define categories, verify script blocking, and align the cookie policy with GDPR or CCPA requirements for your jurisdiction. Have legal counsel review the final implementation.
- How should I test cookie consent behavior in my Laravel app?
- Test that the banner displays, the user's choice persists, and scripts load only after the correct consent is given. Run these checks in your application test suite and in staging after publishing config and assets. The v1.1.0 testing-framework migration is mainly a package-maintenance change but signals the refactor depth you should regression-test.
- What alternatives exist for cookie consent in Laravel?
- Alternatives include general JavaScript cookie-consent libraries, custom Blade and Livewire components, or other Laravel consent packages. This package is a good fit when you want a Livewire, Alpine.js, and Tailwind-based banner with configurable views. Compare upgrade maintenance, script-blocking behavior, and compliance features before choosing.