PHPackages                             weble/laravel-cookiebar - 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. weble/laravel-cookiebar

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

weble/laravel-cookiebar
=======================

Laravel Cookies Consent Management for the new EU Cookie LAW

3.2.0(1y ago)01.8k[1 PRs](https://github.com/Weble/laravel-cookiebar/pulls)MITPHPPHP ^8.0

Since Feb 10Pushed 1y ago2 watchersCompare

[ Source](https://github.com/Weble/laravel-cookiebar)[ Packagist](https://packagist.org/packages/weble/laravel-cookiebar)[ Docs](https://github.com/Weble/laravel-cookiebar)[ RSS](/packages/weble-laravel-cookiebar/feed)WikiDiscussions main Synced 1mo ago

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

Laravel Cookies Consent Management with GTM ConsentMode
=======================================================

[](#laravel-cookies-consent-management-with-gtm-consentmode)

Laravel package for the new EU Cookie LAW. Provides a nice toolbar with a modal to select which consent

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

[](#installation)

```
composer require weble/laravel-cookiebar
```

### Publish Assets

[](#publish-assets)

Copy the assets required to run the laravel cookiebar into your project. This includes the javascript file, the language files and the views.

#### Publish All

[](#publish-all)

```
 php artisan vendor:publish --provider="Weble\Cookiebar\CookiebarServiceProvider"
```

#### Publish Only Views

[](#publish-only-views)

```
 php artisan vendor:publish --tag=cookiebar-views
```

#### Publish Only Assets

[](#publish-only-assets)

```
 php artisan vendor:publish --tag=cookiebar-assets
```

#### Publish Only Translations

[](#publish-only-translations)

```
 php artisan vendor:publish --tag=cookiebar-translations
```

### Config - Optional

[](#config---optional)

You can also optionally publish the configuration file.

```
php artisan vendor:publish --provider="Weble\Cookiebar\CookiebarServiceProvider" --tag="cookiebar-config"
```

Also, remember to follow the installation instructions for [Spatie GoogleTagManager](https://github.com/spatie/laravel-googletagmanager), which is included in this package and required to correctly use the cookeibar.

Usage
-----

[](#usage)

Once you've correctly [Setup Spatie GoogleTagManager](https://github.com/spatie/laravel-googletagmanager), be sure to set the option in the cookiebar configuration file to fit your needs.

Most of all, remember to enable the cookiebar and set the consents you need.

Include `cookiebar::index` in your layout according to your needs, usually before closing the body tag;

Include `cookiebar::default-consents` before `googletagmanager::head`;

Reopening the consent modal.
----------------------------

[](#reopening-the-consent-modal)

You can reopen the consent modal by calling

```
window.gtmCookieBar.editConsents()
```

Usually this is done in a link / button in the footer of your website.

Customizations
--------------

[](#customizations)

By default the cookiebar is styled using Tailwind CSS.

Add this configuration to your `tailwing.config.js` file to set the colors

```
cookiebar: {
   banner: {
       'primary': '', // bg - button
       'secondary': '', // text - buttont
   },
   modal: {
       'drop': '',
       'primary': '', // title
       'secondary': '', // text
   checkbox: {
       'primary': '', // checked - border color
       'secondary': '', // unchecked color
   },
   button: {
       save: {
           'primary': '', // button bg color
           'secondary': '', // button text color
           'hover': '', // button hover color
       },
   cancel: {
       'secondary': '', // button text color
       }
   }
},
```

Add this configuration to your `tailwing.config.js` file to set the checkbox icon

```
...

backgroundImage: theme => ({
    ...
    'cookiebar-modal-checkbox-icon': 'url("data:image/svg+xml,%3csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 20 20\'%3e%3cpath fill=\'none\' stroke=\'%23fff\' stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'3\' d=\'M6 10l3 3l6-6\'/%3e%3c/svg%3e")'
    ...
}),
    ...
```

You can publish the views, assets and translations, and then edit the files in `resources/view/vendor/cookiebar/` to better suit your needs.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 80.2% of commits — single point of failure

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 ~120 days

Recently: every ~209 days

Total

8

Last Release

705d ago

Major Versions

1.0.0 → 2.0.02022-02-14

2.1.1 → 3.0.02023-03-07

PHP version history (2 changes)1.0.0PHP ^7.4|^8.0

2.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2fe88932c3280467c9a30f79205c0f2c85aecd28dae3a9e8b035d773ef6218ef?d=identicon)[Skullbock](/maintainers/Skullbock)

---

Top Contributors

[![npvnll](https://avatars.githubusercontent.com/u/19395078?v=4)](https://github.com/npvnll "npvnll (73 commits)")[![Skullbock](https://avatars.githubusercontent.com/u/1104083?v=4)](https://github.com/Skullbock "Skullbock (18 commits)")

---

Tags

cookiecookie-consenteulawcomplycookiebarweble

### Embed Badge

![Health badge](/badges/weble-laravel-cookiebar/health.svg)

```
[![Health](https://phpackages.com/badges/weble-laravel-cookiebar/health.svg)](https://phpackages.com/packages/weble-laravel-cookiebar)
```

###  Alternatives

[spatie/laravel-cookie-consent

Make your Laravel app comply with the crazy EU cookie law

1.5k4.7M20](/packages/spatie-laravel-cookie-consent)[retinens/laravel-cookie-consent

Make your Laravel app comply with the crazy EU cookie law

354.5k](/packages/retinens-laravel-cookie-consent)[albertborsos/yii2-gdpr-cookie-consent

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

1124.3k1](/packages/albertborsos-yii2-gdpr-cookie-consent)

PHPackages © 2026

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