PHPackages                             code16/cookie-consent-js - 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. code16/cookie-consent-js

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

code16/cookie-consent-js
========================

Cookie consent handled front-only

v1.0.5(5mo ago)02.5k↑42.3%BladePHP &gt;=8.0

Since Jan 17Pushed 5mo ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (9)Used By (0)

Cookie consent
==============

[](#cookie-consent)

Setup
-----

[](#setup)

```
composer require code16/cookie-consent-js
```

**Required**: publish assets (add this in composer.json `post-autoload-dump` scripts)

```
php artisan vendor:publish --provider='Code16\CookieConsent\CookieConsentServiceProvider' --tag=assets --force
```

You may publish the config file:

```
php artisan vendor:publish --provider="Code16\CookieConsent\CookieConsentServiceProvider" --tag=config
```

And the lang file:

```
php artisan vendor:publish --provider="Code16\CookieConsent\CookieConsentServiceProvider" --tag=lang
```

Usage
-----

[](#usage)

In your blade layout

```

    {{-- ... --}}

          {{-- some injected cookies --}}

```

Also you must declare the cookie category in `config/cookie-consent.php` as follow

```
[
    'categories' => [
        'system' => [
            'required' => true,
            'services' => [
                [
                  'cookies' => []
                ]
            ]
        ],
        'analytics' => [
            'services' => [
                'google-analytics' => [
                    'cookies' => [
                        ['name' => '_ga', 'lifetime' => '2 years']
                    ]
                ]
            ]
        ],
    ]
];
```

Categories marked as `required` are cannot be opt-out by the user.

To provide explanation texts in the manage dialog, add content to the lang file:

```
[
    'manage_modal' => [
        'title' => 'Manage cookies',
        'description' => 'About cookies...',
        'categories' => [
            'system' => [
                'title' => 'System cookies',
                'description' => "Description text about system cookies",
            ],
            'analytics' => [
                'title' => 'Analytics cookies',
                'description' => "Description text about analytics cookies",
            ],
        ],
    ]
];
```

### Show the manage modal from a link (e.g. cookies page)

[](#show-the-manage-modal-from-a-link-eg-cookies-page)

In the page:

```
   Open manage cookies modal
```

###  Health Score

44

—

FairBetter than 91% of packages

Maintenance74

Regular maintenance activity

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~199 days

Recently: every ~112 days

Total

8

Last Release

176d ago

Major Versions

v0.1.1 → v1.0.02024-08-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/f97dcdc942d25d5b5720b790d5f28e6accc6f05370cf5a6b52b78abc60c29e57?d=identicon)[code16](/maintainers/code16)

---

Top Contributors

[![aguingand](https://avatars.githubusercontent.com/u/17453506?v=4)](https://github.com/aguingand "aguingand (2 commits)")[![PatrickePatate](https://avatars.githubusercontent.com/u/16721134?v=4)](https://github.com/PatrickePatate "PatrickePatate (1 commits)")

### Embed Badge

![Health badge](/badges/code16-cookie-consent-js/health.svg)

```
[![Health](https://phpackages.com/badges/code16-cookie-consent-js/health.svg)](https://phpackages.com/packages/code16-cookie-consent-js)
```

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

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