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

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

signdeer/laravel-cookie-consent
===============================

A GDPR-compliant cookie consent solution for Laravel applications with fully customizable cookie banners, granular consent control, and enterprise-grade compliance features.

v1.0.9(1y ago)0768MITPHP

Since Jun 24Pushed 1y agoCompare

[ Source](https://github.com/Vincent95/laravel-cookie-consent)[ Packagist](https://packagist.org/packages/signdeer/laravel-cookie-consent)[ Docs](https://github.com/devrabiul/laravel-cookie-consent)[ RSS](/packages/signdeer-laravel-cookie-consent/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (11)Used By (0)

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

[](#laravel-cookie-consent)

This fork is maintained by [Signdeer](https://signdeer.com), a secure, modern platform for e-signatures, approvals, and digital document workflows built for African teams and global standards.

A GDPR-compliant solution offering enterprise-grade compliance with fully customizable cookie banners for Laravel applications. Simplifies regulatory requirements while maintaining excellent user experience and complete customization capabilities.

[![Latest Stable Version](https://camo.githubusercontent.com/9e1165340731cb6d9a112fcfbe0d9107d4bb2b277575ae037069f1dee8d164af/68747470733a2f2f706f7365722e707567782e6f72672f64657672616269756c2f6c61726176656c2d636f6f6b69652d636f6e73656e742f762f737461626c65)](https://packagist.org/packages/devrabiul/laravel-cookie-consent)[![Total Downloads](https://camo.githubusercontent.com/b9309acdf25e1bf842a22ff1930b7c141c9872503b9016d493ab761ec7b15ead/68747470733a2f2f706f7365722e707567782e6f72672f64657672616269756c2f6c61726176656c2d636f6f6b69652d636f6e73656e742f646f776e6c6f616473)](https://packagist.org/packages/devrabiul/laravel-cookie-consent)[![GitHub license](https://camo.githubusercontent.com/fe5a2d6c9e619a644050cd67ff619bc54a05ff081490306223d282d223ad7015/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f64657672616269756c2f6c61726176656c2d636f6f6b69652d636f6e73656e74)](https://camo.githubusercontent.com/fe5a2d6c9e619a644050cd67ff619bc54a05ff081490306223d282d223ad7015/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f64657672616269756c2f6c61726176656c2d636f6f6b69652d636f6e73656e74)[![Buy us a tree](https://camo.githubusercontent.com/130148911f548b001b2ac68a32c0a06559977ca60ada3bf480c72ae4ea093175/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54726565776172652d2546302539462538432542332d6c69676874677265656e)](https://plant.treeware.earth/devrabiul/laravel-cookie-consent)[![GitHub Repo stars](https://camo.githubusercontent.com/81b1645bc1ca7a0d0f6883a20518d82d70cc3babcb9457e4d3bc83bb2bd280a7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f64657672616269756c2f6c61726176656c2d636f6f6b69652d636f6e73656e743f7374796c653d736f6369616c)](https://camo.githubusercontent.com/81b1645bc1ca7a0d0f6883a20518d82d70cc3babcb9457e4d3bc83bb2bd280a7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f64657672616269756c2f6c61726176656c2d636f6f6b69652d636f6e73656e743f7374796c653d736f6369616c)

Features
--------

[](#features)

- 🔥 **One-Click Implementation** – Simple installation via Composer with auto-loaded assets
- ⚡ **Zero Performance Impact** – Lightweight with lazy-loaded components
- 🌍 **RTL &amp; i18n Support** – Full right-to-left compatibility + multilingual translations
- 🌙 **Dark Mode Support** – Auto dark/light mode matching system preferences
- 🛡 **Granular Consent Control** – Category-level cookie management (necessary/analytics/marketing)
- 📦 **Complete Customization** – Override every color, text, and layout via config
- 📱 **Responsive Design** – Perfectly adapts to all devices (mobile/tablet/desktop)
- 🧩 **No Frontend Dependencies** – No jQuery, Bootstrap, or Tailwind required — works everywhere effortlessly

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

[](#installation)

To get started with Cookie Consent, follow these simple steps:

1. Install the package via Composer:

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

2. Publish the package resources by running: (Normal publish)

```
php artisan vendor:publish --provider="Devrabiul\CookieConsent\CookieConsentServiceProvider"
```

Basic Usage
-----------

[](#basic-usage)

Include these components in your Blade templates:

1. Add styles in the `` section:

```
{!! CookieConsent::styles() !!}
```

2. Add scripts before closing ``:

```
{!! CookieConsent::scripts() !!}
```

### Complete Example

[](#complete-example)

```
DOCTYPE html>

    Your Page
    {!! CookieConsent::styles() !!}

    {!! CookieConsent::scripts() !!}

```

Advanced Configuration
----------------------

[](#advanced-configuration)

```
DOCTYPE html>

    Your Page
    {!! CookieConsent::styles() !!}

    {!! CookieConsent::scripts(options: [
        'cookie_lifetime' => config('laravel-cookie-consent.cookie_lifetime', 7),
        'reject_lifetime' => config('laravel-cookie-consent.reject_lifetime', 1),
        'disable_page_interaction' => config('laravel-cookie-consent.disable_page_interaction', true),
        'preferences_modal_enabled' => config('laravel-cookie-consent.preferences_modal_enabled', true),
        'consent_modal_layout' => config('laravel-cookie-consent.consent_modal_layout', 'bar-inline'),
        'flip_button' => config('laravel-cookie-consent.flip_button', true),
        'theme' => config('laravel-cookie-consent.theme', 'default'),
        'cookie_prefix' => config('laravel-cookie-consent.cookie_prefix', 'Laravel_App'),
        'policy_links' => config('laravel-cookie-consent.policy_links', [
            ['text' => CookieConsent::translate('Privacy Policy'), 'link' => url('privacy-policy')],
            ['text' => CookieConsent::translate('Terms & Conditions'), 'link' => url('terms-and-conditions')],
        ]),
        'cookie_categories' => config('laravel-cookie-consent.cookie_categories', [
            'necessary' => [
                'enabled' => true,
                'locked' => true,
                'js_action' => 'loadGoogleAnalytics',
                'title' => CookieConsent::translate('Essential Cookies'),
                'description' => CookieConsent::translate('These cookies are essential for the website to function properly.'),
            ],
            'analytics' => [
                'enabled' => env('COOKIE_CONSENT_ANALYTICS', false),
                'locked' => false,
                'title' => CookieConsent::translate('Analytics Cookies'),
                'description' => CookieConsent::translate('These cookies help us understand how visitors interact with our website.'),
            ],
            'marketing' => [
                'enabled' => env('COOKIE_CONSENT_MARKETING', false),
                'locked' => false,
                'js_action' => 'loadFacebookPixel',
                'title' => CookieConsent::translate('Marketing Cookies'),
                'description' => CookieConsent::translate('These cookies are used for advertising and tracking purposes.'),
            ],
            'preferences' => [
                'enabled' => env('COOKIE_CONSENT_PREFERENCES', false),
                'locked' => false,
                'js_action' => 'loadPreferencesFunc',
                'title' => CookieConsent::translate('Preferences Cookies'),
                'description' => CookieConsent::translate('These cookies allow the website to remember user preferences.'),
            ],
        ]),
        'cookie_title' => CookieConsent::translate('Cookie Disclaimer'),
        'cookie_description' => CookieConsent::translate('This website uses cookies to enhance your browsing experience, analyze site traffic, and personalize content. By continuing to use this site, you consent to our use of cookies.'),
        'cookie_modal_title' => CookieConsent::translate('Cookie Preferences'),
        'cookie_modal_intro' => CookieConsent::translate('You can customize your cookie preferences below.'),
        'cookie_accept_btn_text' => CookieConsent::translate('Accept All'),
        'cookie_reject_btn_text' => CookieConsent::translate('Reject All'),
        'cookie_preferences_btn_text' => CookieConsent::translate('Manage Preferences'),
        'cookie_preferences_save_text' => CookieConsent::translate('Save Preferences'),
    ]) !!}

```

### 🌙 Enable Dark Mode

[](#-enable-dark-mode)

Add `theme="dark"` to your `` tag to automatically enable dark mode.

```

```

---

### 🌐 Enable RTL Mode

[](#-enable-rtl-mode)

Add `dir="rtl"` to your `` tag to enable right-to-left layout for RTL languages.

```

```

Layout Options
--------------

[](#layout-options)

### Config Status Control

[](#config-status-control)

```
COOKIE_CONSENT_ENABLED=true
COOKIE_CONSENT_PREFERENCES_ENABLED=true

COOKIE_CONSENT_ANALYTICS=true
COOKIE_CONSENT_MARKETING=true
COOKIE_CONSENT_PREFERENCES=true
```

### Consent Modal Styles

[](#consent-modal-styles)

- **`box`** - Compact floating dialog
- **`box-inline`** - Inline positioned box
- **`box-wide`** - Expanded floating dialog
- **`cloud`** - Modern floating design
- **`cloud-inline`** - Compact cloud variant
- **`bar`** - Top/bottom banner
- **`bar-inline`** - Compact banner

*Default: `box-wide`*

### Preferences Modal Styles

[](#preferences-modal-styles)

- **`bar`** - Full-width layout
- **`box`** - Centered popup

*Default: `bar`*

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

[](#configuration)

Edit `config/cookie-consent.php` to modify:

- Cookie lifetimes
- Visual styles
- Text content
- Category settings

### Example service loader (replace with your actual implementation)

[](#example-service-loader-replace-with-your-actual-implementation)

```
function loadGoogleAnalytics() {
    // Please put your GA script in loadGoogleAnalytics()
    // You can define function name from - {!! CookieConsent::scripts() !!}

    window.dataLayer = window.dataLayer || [];

    function gtag() {
        dataLayer.push(arguments);
    }

    gtag('js', new Date());
    gtag('config', 'YOUR_GA_ID');

    // Load the GA script
    const script = document.createElement('script');
    script.src = 'https://www.googletagmanager.com/gtag/js?id=YOUR_GA_ID';
    script.async = true;
    document.head.appendChild(script);
}

function loadFacebookPixel() {
    // Please put your marketing script in loadFacebookPixel()
    // You can define function name from - {!! CookieConsent::scripts() !!}

    !function (f, b, e, v, n, t, s) {
        if (f.fbq) return;
        n = f.fbq = function () {
            n.callMethod ?
                n.callMethod.apply(n, arguments) : n.queue.push(arguments)
        };
        if (!f._fbq) f._fbq = n;
        n.push = n;
        n.loaded = !0;
        n.version = '2.0';
        n.queue = [];
        t = b.createElement(e);
        t.async = !0;
        t.src = v;
        s = b.getElementsByTagName(e)[0];
        s.parentNode.insertBefore(t, s)
    }(window, document, 'script',
        'https://connect.facebook.net/en_US/fbevents.js');
    fbq('init', 'YOUR_PIXEL_ID');
    fbq('track', 'PageView');
}
```

### 🎯 Get Started Today!

[](#-get-started-today)

Experience the magic of CookieConsent and enhance your Laravel applications with Cookie Consent.

🔗 **GitHub:** [Laravel Cookie Consent](https://github.com/devrabiul/laravel-cookie-consent)
🔗 \*\*Packagist: \*\*

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

[](#contributing)

We welcome contributions to CookieConsent! If you would like to contribute, please fork the repository and submit a pull request. For any issues or feature requests, please open an issue on GitHub.

Please:

1. Fork the repository
2. Create your feature branch
3. Submit a pull request

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

🌱 Treeware
----------

[](#-treeware)

This package is [Treeware](https://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/devrabiul/laravel-cookie-consent) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

Contact
-------

[](#contact)

For support or inquiries, please reach out to us at [Send Mail](mailto:devrabiul@gmail.com).

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance49

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.8% 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 ~0 days

Total

10

Last Release

370d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14187746?v=4)[Vincent Mungai](/maintainers/Vincent95)[@Vincent95](https://github.com/Vincent95)

---

Top Contributors

[![devrabiul](https://avatars.githubusercontent.com/u/112581088?v=4)](https://github.com/devrabiul "devrabiul (30 commits)")[![Vincent95](https://avatars.githubusercontent.com/u/14187746?v=4)](https://github.com/Vincent95 "Vincent95 (11 commits)")[![rabiul6am](https://avatars.githubusercontent.com/u/128285760?v=4)](https://github.com/rabiul6am "rabiul6am (6 commits)")

---

Tags

laravelcookiebannergdprcomplianceprivacyconsent

### Embed Badge

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

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

###  Alternatives

[statikbe/laravel-cookie-consent

Cookie consent modal for EU

219426.2k](/packages/statikbe-laravel-cookie-consent)[devrabiul/laravel-cookie-consent

A GDPR-compliant cookie consent solution for Laravel applications with fully customizable cookie banners, granular consent control, and enterprise-grade compliance features.

18355.4k1](/packages/devrabiul-laravel-cookie-consent)[selli/laravel-gdpr-consent-database

A simple consent database for laravel applications to manage GDPR consents

181.4k](/packages/selli-laravel-gdpr-consent-database)[martin-schenk/laravel-cookie-consent

GDPR-compliant cookie consent system with minimal dependencies for Laravel 11 and 12

112.3k](/packages/martin-schenk-laravel-cookie-consent)

PHPackages © 2026

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