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

4.0.1(1mo ago)01.8k[1 PRs](https://github.com/Weble/laravel-cookiebar/pulls)MITPHPPHP ^8.0CI failing

Since Feb 10Pushed 1mo 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 yesterday

READMEChangelogDependencies (14)Versions (14)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

48

—

FairBetter than 93% of packages

Maintenance90

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 73% 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 ~172 days

Recently: every ~290 days

Total

10

Last Release

52d ago

Major Versions

1.0.0 → 2.0.02022-02-14

2.1.1 → 3.0.02023-03-07

3.2.0 → 4.0.02026-05-13

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

2.0.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1104083?v=4)[Daniele Rosario](/maintainers/Skullbock)[@Skullbock](https://github.com/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)")[![matteodvlp](https://avatars.githubusercontent.com/u/132575178?v=4)](https://github.com/matteodvlp "matteodvlp (9 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.5k5.0M25](/packages/spatie-laravel-cookie-consent)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[retinens/laravel-cookie-consent

Make your Laravel app comply with the crazy EU cookie law

354.6k](/packages/retinens-laravel-cookie-consent)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

725173.0k14](/packages/tallstackui-tallstackui)

PHPackages © 2026

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