Download the PHP package keepsuit/laravel-cookie-solution without Composer
On this page you can find all versions of the php package keepsuit/laravel-cookie-solution. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download keepsuit/laravel-cookie-solution
More information about keepsuit/laravel-cookie-solution
Files in keepsuit/laravel-cookie-solution
Package laravel-cookie-solution
Short Description Make your site comply with EU cookie law
License MIT
Homepage https://github.com/keepsuit/laravel-cookie-solution
Informations about the package laravel-cookie-solution
Make your site comply with EU cookie law
This package provides a configurable cookie banner for your Laravel application. It also includes templates for cookie policy and privacy policy pages.
Note that this package is not a legal advice. You should always consult a lawyer and change texts and policies for your needs.
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
Optionally, you can publish the assets, views and translations using.
If you publish the assets, remember to publish new versions when you update the package.
You can automate this using composer post-update-cmd
script:
Usage
Include the cookie solution script in your layout (it's recommended to include it in the <head>
tag):
Register used services in your 'AppServiceProvider' (You can register your own services with Service
class):
Update the config config/cookie-consent.php
file with your data owner's contact email and name and address.
Create a route for the cookie policy page and include the cookie policy partial:
Create a route for the privacy policy page and include the privacy policy partial:
See views customization section for more information about the partials and how to customize them.
Customization
Highlight color
Yon can customize the highlight color of the banner and toggle changing the highlight_color
config value.
Toggle position
You can change the toggle position to left
or right
by changing the toggle_position
config value (default to right
).
If you need a more advanced customization, you can edit the toggle position with some CSS:
Views
If you want to customize the views, you can publish them with php artisan vendor:publish --tag="cookie-solution-views"
and style them however you like.
The <cookie-solution-policy-formatter/>
custom component is used to apply the default styles, you can safely remove it to customize the views.
Checking status
You can check the user's consent status from laravel using the CookieSolution::status()
method,
which returns a CookieSolutionStatus
object with helpers to check if a purpose has been accepted.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Fabio Capucci
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-cookie-solution with dependencies
illuminate/contracts Version ^9.0 || ^10.0 || ^11.0
spatie/laravel-package-tools Version ^1.13.0
symfony/intl Version ^6.2 || ^7.0