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

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

mrshanebarron/cookie-consent
============================

Cookie consent banner component for Laravel - supports Livewire and Vue

v1.0.3(4mo ago)08MITPHPPHP ^8.1

Since Dec 14Pushed 4mo agoCompare

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

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

Cookie Consent
==============

[](#cookie-consent)

A GDPR-compliant cookie consent banner for Laravel applications. Shows a dismissible notice about cookie usage. Works with Livewire and Vue 3.

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

[](#installation)

```
composer require mrshanebarron/cookie-consent
```

Livewire Usage
--------------

[](#livewire-usage)

### Basic Usage

[](#basic-usage)

```

```

### Custom Message

[](#custom-message)

```

```

### With Privacy Link

[](#with-privacy-link)

```

```

### Position

[](#position)

```

```

### Livewire Props

[](#livewire-props)

PropTypeDefaultDescription`message`string`'This site uses cookies...'`Banner message`accept-text`string`'Accept'`Accept button text`decline-text`string`'Decline'`Decline button text`privacy-url`string`null`Link to privacy policy`position`string`'bottom'`Position: `top` or `bottom`Vue 3 Usage
-----------

[](#vue-3-usage)

### Setup

[](#setup)

```
import { SbCookieConsent } from './vendor/sb-cookie-consent';
app.component('SbCookieConsent', SbCookieConsent);
```

### Basic Usage

[](#basic-usage-1)

```

```

### Custom Configuration

[](#custom-configuration)

```

```

### With Callback

[](#with-callback)

```

const onAccept = () => {
  // Enable analytics, etc.
  console.log('Cookies accepted');
};

const onDecline = () => {
  // Disable non-essential cookies
  console.log('Cookies declined');
};

```

### Vue Props

[](#vue-props)

PropTypeDefaultDescription`message`StringDefault messageBanner text`acceptText`String`'Accept'`Accept button text`declineText`String`'Decline'`Decline button text`privacyUrl`String`null`Privacy policy URL`position`String`'bottom'``'top'` or `'bottom'`### Events

[](#events)

EventDescription`accept`User accepted cookies`decline`User declined cookiesFeatures
--------

[](#features)

- **Persistent**: Remembers user choice in localStorage
- **GDPR Friendly**: Accept and decline options
- **Privacy Link**: Optional link to privacy policy
- **Positions**: Top or bottom of screen
- **Auto-hide**: Disappears after user choice

Storage
-------

[](#storage)

User preference is stored in localStorage:

- Key: `cookie-consent`
- Values: `'accepted'` or `'declined'`

Styling
-------

[](#styling)

Uses Tailwind CSS:

- Fixed position banner
- Dark background
- White text
- Primary color accept button
- Secondary decline button

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10, 11, or 12
- Tailwind CSS 3.x

License
-------

[](#license)

MIT License

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance79

Regular maintenance activity

Popularity4

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

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

4

Last Release

144d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7a38dc9b4ccc180ee3e9df8879f8747ea9dbf36812c6546827fe504fa8993eb8?d=identicon)[mrshanebarron](/maintainers/mrshanebarron)

---

Tags

laravellivewirecookievuegdprconsent

### Embed Badge

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

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

###  Alternatives

[statikbe/laravel-cookie-consent

Cookie consent modal for EU

213396.7k](/packages/statikbe-laravel-cookie-consent)[bezhansalleh/filament-google-analytics

Google Analytics integration for FilamentPHP

205144.8k5](/packages/bezhansalleh-filament-google-analytics)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

116.6k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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