jonassiewertsen/statamic-cookie-consent

A Statamic cookie consent wrapper for the Spatie package 'laravel-cookie-consent'

v1.0-beta.4 2021-08-29 19:57 UTC

This package is auto-updated.

Last update: 2021-11-29 20:33:21 UTC


README

Statamic 3.0+ Latest Version on Packagist

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!