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


Statamic 3.0+ Latest Version on Packagist

This Package is basically a wrapper for the Laravel Cookie Consent Package from Spatie.


Pull in your package with composer

composer require jonassiewertsen/statamic-cookie-consent


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.
    <button class="js-cookie-consent-agree cookie-consent__agree">
        Allow cookies


Disabling the cookie consent

You can disable the package in your .env file


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"


This Package / Addon is open source. Feel free to contribute or use it however you like!