This package for Laravel allows you to manage user cookies consents in compliance with privacy regulations.
w3designweb/laravel-cookie-consent is a Laravel package for this package for laravel allows you to manage user cookies consents in compliance with privacy regulations..
It currently has 0 GitHub stars and 190 downloads on Packagist (latest version v1.2.0).
Install it with composer require w3designweb/laravel-cookie-consent.
Discover more Laravel packages by w3designweb
or browse all Laravel packages to compare alternatives.
Last updated
With this package it will be easy for you to declare all the cookies used on your website, asking for consent through a banner that will be activated automatically through a Laravel Middleware.
Each user can accept or not the different types of cookies, thus deciding whether to enable the related functions, and also can change the consents given over time.
Require the package with Composer:
composer require w3designweb/laravel-cookie-consent
For Laravel 5.4 and lower, add the service provider to config/app.php:
W3designweb\LaravelCookieConsent\LaravelCookieConsentServiceProvider::class,
Add the service provider to bootstrap/app.php:
$app->register(W3designweb\LaravelCookieConsent\LaravelCookieConsentServiceProvider::class);
Then, add this configuration to your .env file to enable the cookie banner. By default the value is set to "true", but it will be sufficient to indicate "false" to not show the cookie banner.
COOKIE_CONSENT_ENABLED=true
COOKIE_CONSENT_NAME=your_cookie_consent_name
After that, add the middleware in the group of your choice, inside the App/Http/Kernel.php file, per example:
'web' => [
...
W3designweb\LaravelCookieConsent\Http\Middleware\LaravelCookieConsent::class,
...
],
Publish the package files to manage your cookies list in the config file, the blade template on the view file and the assets in CSS and JS file:
php artisan vendor:publish --provider="W3designweb\LaravelCookieConsent\LaravelCookieConsentServiceProvider"