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)0105MITPHPPHP ^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 today

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

27

—

LowBetter than 47% of packages

Maintenance46

Moderate activity, may be stable

Popularity11

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

421d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/42177921?v=4)[R de la Cour](/maintainers/Salsa85)[@Salsa85](https://github.com/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

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M282](/packages/illuminate-pipeline)[statamic/seo-pro

68516.6k](/packages/statamic-seo-pro)[reachweb/statamic-livewire-filters

Livewire filters for Statamic collections.

1713.2k](/packages/reachweb-statamic-livewire-filters)

PHPackages © 2026

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