PHPackages                             zencule/cookie-banner - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. zencule/cookie-banner

ActiveStatamic-addon[Utility &amp; Helpers](/categories/utility)

zencule/cookie-banner
=====================

A modern, customizable cookie consent banner for Laravel and Statamic applications

0.2.1(1y ago)082MITPHPPHP ^8.1

Since May 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Salsa85/cookie-banner)[ Packagist](https://packagist.org/packages/zencule/cookie-banner)[ RSS](/packages/zencule-cookie-banner/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (7)Used By (0)

Zencule Cookie Banner
=====================

[](#zencule-cookie-banner)

A modern, customizable cookie consent banner for Laravel and Statamic applications. Built with Alpine.js and plain CSS (no Tailwind required).

[![License](https://camo.githubusercontent.com/ca2b58f6801bfe80756d8ecf9833b723061d63402b892d613ff971f7bbf80b43/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7a656e63756c652f636f6f6b69652d62616e6e6572)](https://camo.githubusercontent.com/ca2b58f6801bfe80756d8ecf9833b723061d63402b892d613ff971f7bbf80b43/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7a656e63756c652f636f6f6b69652d62616e6e6572)

Features
--------

[](#features)

- 🎨 Modern, responsive design with plain CSS (no Tailwind required)
- ⚡ Smooth animations with Alpine.js
- 📊 Google Analytics integration
- 🔒 GDPR-compliant with essential/all cookies options
- 🎯 Works with both Laravel and Statamic
- ⚙️ Fully customizable through config

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require zencule/cookie-banner
```

### CSS

[](#css)

The package includes a plain CSS file for styling. To use the default styles, import or copy `cookie-banner.css` from the package's `resources/` directory into your project and include it in your main CSS or HTML:

```

```

Or, if using a bundler:

```
import 'cookie-banner/resources/cookie-banner.css';
```

### Laravel

[](#laravel)

The package will automatically register its service provider.

Publish the configuration file:

```
php artisan vendor:publish --tag=cookie-banner
```

### Statamic

[](#statamic)

The package will automatically register as a Statamic addon.

Publish the configuration file:

```
php artisan vendor:publish --tag=cookie-banner
```

Usage
-----

[](#usage)

### Laravel

[](#laravel-1)

Add the cookie banner to your layout file:

```
@include('cookie-banner::banner')
```

### Statamic

[](#statamic-1)

Add the cookie banner to your layout file:

```
{{ zencule:cookie-banner }}
```

Configuration
-------------

[](#configuration)

Configure the banner in `config/cookie-banner.php`:

```
return [
    'privacy_policy_url' => env('COOKIE_BANNER_PRIVACY_URL', '/privacy-policy'),

    'analytics_id' => env('COOKIE_BANNER_ANALYTICS_ID', ''),

    'messages' => [
        'banner_text' => 'We use cookies to improve your experience...',
        'essential_button' => 'Essential Only',
        'accept_button' => 'Accept All',
        'more_info' => 'More Information',
    ],
];
```

Customization
-------------

[](#customization)

### Styling

[](#styling)

The banner uses plain CSS classes by default. You can customize the appearance by:

1. Publishing the views:

```
php artisan vendor:publish --tag=cookie-banner
```

2. Modifying the templates in:

    - Laravel: `resources/views/vendor/cookie-banner/blade/banner.blade.php`
    - Statamic: `resources/views/vendor/cookie-banner/antlers/banner.antlers.html`
3. Editing the CSS file:

    - Copy or import `resources/cookie-banner.css` and modify it as needed for your branding.

### Analytics

[](#analytics)

By default, the package supports Google Analytics. Set your Analytics ID in your `.env` file:

```
COOKIE_BANNER_ANALYTICS_ID=G-XXXXXXXXXX
```

The script will only load after the user accepts all cookies.

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 10.0 or higher
- Statamic 4.0 or higher (for Statamic integration)
- Alpine.js

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Zencule](https://github.com/zencule)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance49

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

6

Last Release

374d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/72fe72d9e80eed7b35733df0a18ea4188ec0444d83b2e2e20f694eda7e011775?d=identicon)[Salsa85](/maintainers/Salsa85)

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/zencule-cookie-banner/health.svg)

```
[![Health](https://phpackages.com/badges/zencule-cookie-banner/health.svg)](https://phpackages.com/packages/zencule-cookie-banner)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[illuminate/pipeline

The Illuminate Pipeline package.

9346.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)[mrmarchone/laravel-auto-crud

Laravel Auto CRUD helps you streamline development and save time.

28711.8k2](/packages/mrmarchone-laravel-auto-crud)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
