jonassiewertsen / statamic-cookie-consent
A Statamic cookie consent wrapper for the Spatie package 'laravel-cookie-consent'
Installs: 35
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 1
Type:statamic-addon
Requires
- php: ^7.4 || ^8.0
- illuminate/support: 6.* || 7.* || 8.*
- spatie/laravel-cookie-consent: 2.*
- statamic/cms: 3.*
This package is auto-updated.
Last update: 2024-11-29 06:10:35 UTC
README
This Package is basically a wrapper for the Laravel Cookie Consent Package from Spatie.
Installation
Pull in your package with composer
composer require jonassiewertsen/statamic-cookie-consent
Styling
Remember to write some nice CSS to style the consent banner.
Those are the default classes
<div class="js-cookie-consent cookie-consent"> <span class="cookie-consent__message"> Your experience on this site will be improved by allowing cookies. </span> <button class="js-cookie-consent-agree cookie-consent__agree"> Allow cookies </button> </div>
Settings
Disabling the cookie consent
You can disable the package in your .env file
COOKIE_CONSENT_ENABLED=false
Publishing the lang files
php artisan vendor:publish --provider="Spatie\CookieConsent\CookieConsentServiceProvider" --tag="lang"
Publishing the view
php artisan vendor:publish --provider="Spatie\CookieConsent\CookieConsentServiceProvider" --tag="views"
Publishing the config file
php artisan vendor:publish --provider="Spatie\CookieConsent\CookieConsentServiceProvider" --tag="config"
License
This Package / Addon is open source. Feel free to contribute or use it however you like!