Download the PHP package pierre-adrien/laravel-cookie-consent without Composer
On this page you can find all versions of the php package pierre-adrien/laravel-cookie-consent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pierre-adrien/laravel-cookie-consent
More information about pierre-adrien/laravel-cookie-consent
Files in pierre-adrien/laravel-cookie-consent
Package laravel-cookie-consent
Short Description This package provides a fully configurable cookie-consent popup for a Laravel project.
License MIT
Informations about the package laravel-cookie-consent
Laravel Cookie-Consent
Report Bug · Request Feature
Table of Contents
- About The Project
- Installation
- Usage
- Configuration
- Contributing
- License
- Contact
About The Project
Passed in the 2002 and amended in 2009, the ePrivacy Directive (EPD) has become known as the “cookie law” since its most notable effect was the proliferation of cookie consent pop-ups after it was passed. It supplements (and in some cases, overrides) the GDPR, addressing crucial aspects about the confidentiality of electronic communications and the tracking of Internet users more broadly.
To comply with the regulations governing cookies under the GDPR and the ePrivacy Directive you must:
- Receive users’ consent before you use any cookies except strictly necessary cookies.
- Provide accurate and specific information about the data each cookie tracks and its purpose in plain language before consent is received.
- Document and store consent received from users.
- Allow users to access your service even if they refuse to allow the use of certain cookies.
- Make it as easy for users to withdraw their consent as it was for them to give their consent in the first place.
This package provides a fully configurable cookie-consent popup for a Laravel project.
Here is a standard use of it. All possibilities are described in this documentation.
Validation popup home
Validation popup preferences (not validated)
Validation popup preferences (validated)
Installation
-
The package can be installed via composer :
- Publish files :
Configuration : allow you to modify the configuration of the displayed popup.
Assets : REQUIRED to proper execution.
Languages : allow you to set the translations.
Views : allow you to modify the displayed popup.
Usage
Add the cookie-consent popup at the end of your "body" tag :
Add content depending on a consent for a cookie key or a group key :
You can also use the method in your php code with the facade.
Configuration
All the configurations of the published "config/cookie-consent.php" file are listed and explained here.
Cookie lifetime
- Define the user cookie consent's duration.
- Configuration key : "cookie_lifetime".
- Default value : 1 year.
- Unit : minutes.
Cookie name
- Define the user cookie consent's cookie name.
- Configuration key : "cookie_name".
- Default value : "cookie-consent".
- Unit : string.
Cookies
- Define the cookies the user has to consent.
- Configuration key : "cookies".
- Default value : random cookies configurations, change it with what you need.
- Unit : array.
- Each cookie configuration contains some keys :
- key : key of the cookie, must be unique.
- title : translation key for the title.
- description : translation key for the description.
- group : a group key (only used with a group display, see "Preferences display mode").
- locked : if set to "true", this cookie is only displayed for information, it is not part of the validation process.
Groups
- Define the cookie groups the user has to consent (only used with a group display, see "Preferences display mode").
- Configuration key : "cookies-group".
- Default value : random cookies groups configurations, change it with what you need.
- Unit : array.
- Each cookie group configuration contains some keys :
- key : key of the group, must be unique and not the same of a cookie's key.
- title : translation key for the title.
- description : translation key for the description.
- locked : if set to "true", this group is only displayed for information, it is not part of the validation process.
Custom class
- Define one, or many class to customize the popup design.
- Configuration key : "custom-class".
- Default value : empty.
- Unit : string.
IHM ids
- Used to override the ids of the popup if already exists in your website.
- Configuration key : "ihmIds".
- Default value : default ids.
- Unit : array.
Position
- Set the position of the popup. Can be set to "top" or "bottom".
- Configuration key : "position".
- Default value : "bottom".
- Unit : string.
Preferences display mode
- Set the preferences popup display mode. Can be set to "list" or "group".
- Configuration key : "preferences-display-mode".
- Default value : "list".
- Unit : string.
List display
Group display
Preferences validation mode
- Set the preferences popup validation mode (only used with a group display, see "Preferences display mode"). Can be set to "item" or "group".
- Configuration key : "preferences-validation-mode".
- Default value : "group".
- Unit : string.
Group validation
Item validation
Routes
- Used to override the routes of the package if already exists in your website.
- Configuration key : "routes".
- Default value : default routes.
- Unit : array.
Update preferences button ids
- One or many ids of your present in your website to reopen the validation popup.
- Configuration key : "updatePreferencesButtonIds".
- Default value : "update-preferences".
- Unit : string or array.
Contributing
To contribute you can :
- Open an issue
- Create a Pull Request with your modifications and corresponding unit tests.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/myFeature
) - Commit your Changes (
git commit -m 'message'
) - Push to the Branch (
git push origin feature/myFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
Project Link: https://github.com/Pierre-Adrien/laravel-cookie-consent