PHPackages                             jeffersongoncalves/laravel-cookie-consent - 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. jeffersongoncalves/laravel-cookie-consent

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

jeffersongoncalves/laravel-cookie-consent
=========================================

This Laravel package provides a simple and elegant way to implement cookie consent on your website, ensuring compliance with privacy regulations like GDPR and CCPA. It offers a clean and customizable interface, allowing you to easily manage and display cookie consent banners and preferences.

v3.0.3(2mo ago)410.3k↑47.4%1MITBladePHP ^8.2|^8.3CI passing

Since Mar 1Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/jeffersongoncalves/laravel-cookie-consent)[ Packagist](https://packagist.org/packages/jeffersongoncalves/laravel-cookie-consent)[ Docs](https://github.com/jeffersongoncalves/laravel-cookie-consent)[ GitHub Sponsors](https://github.com/jeffersongoncalves)[ RSS](/packages/jeffersongoncalves-laravel-cookie-consent/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (9)Dependencies (12)Versions (12)Used By (1)

[![Laravel Cookie Consent](https://raw.githubusercontent.com/jeffersongoncalves/laravel-cookie-consent/master/art/jeffersongoncalves-laravel-cookie-consent.png)](https://raw.githubusercontent.com/jeffersongoncalves/laravel-cookie-consent/master/art/jeffersongoncalves-laravel-cookie-consent.png)

Laravel Cookie Consent
======================

[](#laravel-cookie-consent)

[![Latest Version on Packagist](https://camo.githubusercontent.com/58150e4944a3bb26ccf1e6468ca7c3dc00297c8e9e403feb6d2ee5c2778a5f63/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6566666572736f6e676f6e63616c7665732f6c61726176656c2d636f6f6b69652d636f6e73656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeffersongoncalves/laravel-cookie-consent)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/a598aeefe6fb56d9f3b626a9d39c3581c994505b24f12f0c9ff53850fb8a5eee/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6566666572736f6e676f6e63616c7665732f6c61726176656c2d636f6f6b69652d636f6e73656e742f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d6173746572266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/jeffersongoncalves/laravel-cookie-consent/actions?query=workflow%3A%22Fix+PHP+code+styling%22+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/4f8f3e8754ad3ca36a1eb7bce3876ebb02a6fc4a4ff46108661d931fabff042f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6566666572736f6e676f6e63616c7665732f6c61726176656c2d636f6f6b69652d636f6e73656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeffersongoncalves/laravel-cookie-consent)

This Laravel package provides a simple and elegant way to implement cookie consent on your website, ensuring compliance with privacy regulations like GDPR and CCPA. It offers a clean and customizable interface, allowing you to easily manage and display cookie consent banners and preferences.

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

[](#installation)

You can install the package via composer:

```
composer require jeffersongoncalves/laravel-cookie-consent
```

Run the migrations to create the settings in the database:

```
php artisan migrate
```

Usage
-----

[](#usage)

Add head template.

```
@include('cookie-consent::cookie-consent-head')
```

Add body template.

```
@include('cookie-consent::cookie-consent-body')
```

Publish views (optional).

```
php artisan vendor:publish --tag=cookie-consent-views
```

Publish settings migrations (optional).

```
php artisan vendor:publish --tag=cookie-consent-settings-migrations
```

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

[](#configuration)

All settings are stored in the database using [spatie/laravel-settings](https://github.com/spatie/laravel-settings). You can access and modify them at runtime using the `CookieConsentSettings` class or the `cookie_consent_settings()` helper.

### Accessing settings

[](#accessing-settings)

```
use JeffersonGoncalves\CookieConsent\Settings\CookieConsentSettings;

// Via helper
$settings = cookie_consent_settings();

// Via container
$settings = app(CookieConsentSettings::class);

// Read a value
$position = $settings->position;
```

### Updating settings

[](#updating-settings)

```
$settings = cookie_consent_settings();
$settings->position = 'top-right';
$settings->popup_background = '#000000';
$settings->save();
```

### Available settings

[](#available-settings)

PropertyTypeDefault`css_url``string``https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css``js_url``string``https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js``content_header``string``Cookies used on the website!``content_message``string``This website uses cookies to ensure you get the best experience on our website.``content_dismiss``string``Got it!``content_allow``string``Allow cookies``content_deny``string``Decline``content_link``string``Learn more``content_href``?string``null``content_close``string``&#x274c;``content_target``string``_blank``content_policy``string``Cookie Policy``popup_background``string``#696969``popup_text``string``#FFFFFF``popup_link``string``#FFFFFF``button_background``string``transparent``button_border``string``#f8e71c``button_text``string``#f8e71c``highlight_background``string``#f8e71c``highlight_border``string``#f8e71c``highlight_text``string``#000000``position``string``bottom-left``theme``string``block`### Position

[](#position)

Top LeftTop Right[![Top Left](screenshots/cookie-consent-top-left.png)](screenshots/cookie-consent-top-left.png)[![Top Right](screenshots/cookie-consent-top-right.png)](screenshots/cookie-consent-top-right.png)**Bottom Left****Bottom Right**[![Bottom Left](screenshots/cookie-consent-bottom-left.png)](screenshots/cookie-consent-bottom-left.png)[![Bottom Right](screenshots/cookie-consent-bottom-right.png)](screenshots/cookie-consent-bottom-right.png)Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

This package uses the [Osano CookieConsent](https://github.com/osano/cookieconsent) plugin.

- [Jèfferson Gonçalves](https://github.com/jeffersongoncalves)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance90

Actively maintained with recent releases

Popularity30

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 79.4% 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 ~46 days

Recently: every ~15 days

Total

10

Last Release

68d ago

Major Versions

v1.2.0 → v2.0.02026-02-23

v2.0.0 → v3.0.02026-02-23

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/411493?v=4)[Jefferson Gonçalves](/maintainers/jeffersongoncalves)[@jeffersongoncalves](https://github.com/jeffersongoncalves)

---

Top Contributors

[![jeffersongoncalves](https://avatars.githubusercontent.com/u/411493?v=4)](https://github.com/jeffersongoncalves "jeffersongoncalves (50 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (1 commits)")

---

Tags

ccpacomposercookie-bannercookie-consentcookieconsentgdprjeffersongoncalveslaravellaravel-packagephpprivacylaraveljeffersongoncalveslaravel-cookie-consent

###  Code Quality

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/jeffersongoncalves-laravel-cookie-consent/health.svg)

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

###  Alternatives

[finity-labs/fin-mail

A powerful email template manager and composer for Filament with dynamic token replacement, template versioning, and inline email sending.

284.5k1](/packages/finity-labs-fin-mail)

PHPackages © 2026

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