PHPackages                             hivedrops/hive-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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. hivedrops/hive-consent

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

hivedrops/hive-consent
======================

This package has been designed to help you generate an RGPD (General Data Protection Regulation) compliant cookie banner. Using this package, you can easily integrate a cookie banner on your website, ensuring legal compliance with regard to the collection and management of users' personal data.

1.2.1(1y ago)030MITBladePHP ^8.0

Since Jul 5Pushed 1y agoCompare

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

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

Hive Consent
============

[](#hive-consent)

[![Hive Consent Banner](assets/images/presentation_hiveConsent.jpg)](assets/images/presentation_hiveConsent.jpg)

The Hive Consent package lets you add a cookie consent banner to your Laravel applications. The package is simple to use and easy to customize.

Features
--------

[](#features)

- Cookie consent banner
- Customizable views
- Customizable configuration
- Customizable analytics tools (by default: Google Analytics)
- Light and dark mode
- Multi-language support (English and French)
- Easy to use

How to upgrade
--------------

[](#how-to-upgrade)

To upgrade to the latest version, just one command !

```
composer update hivedrops/hive-consent
```

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

[](#installation)

### Prerequisites

[](#prerequisites)

- PHP &gt;= 7.2
- TAILWIND CSS &gt;= 2.0

### Step 1: Install the package via Composer

[](#step-1-install-the-package-via-composer)

You can install the package via composer:

```
composer require hivedrops/hive-consent
```

### Step 2: Use the package

[](#step-2-use-the-package)

You can use the package in your views by adding the following code:

```

        @include('hive-consent::hive-consent-script')

        @include('hive-consent::hive-consent-banner')
        {{-- Your code here --}}

```

### Optional: Publish the views assets

[](#optional-publish-the-views-assets)

If you want to customize the views, you can publish the views:

```
php artisan hive-consent:publish-views
```

A `hive-consent` directory will be created in your `resources/views/vendor` directory.

### Optional: Publish the config file

[](#optional-publish-the-config-file)

You can edit url for privacy policy and cookie policy with a variable in the `env` file:

```
HIVE_CONSENT_URL="/cookie-policy" // You can change this to your own url
HIVE_CONSENT_LANGUAGE="en" // You can change this for "fr" if you want to use the french version
HIVE_CONSENT_GOOGLE_ANALYTICS="G-XXXXXXXXXX" // You can change this to your own Google Analytics ID
```

if you want to change the default configuration, you can publish the config file:

```
php artisan hive-consent:publish-config
```

### Optional: Publish the languages assets

[](#optional-publish-the-languages-assets)

If you want to customize the languages, you can publish the languages:

```
php artisan hive-consent:publish-lang
```

A `hive-consent` directory will be created in your `resources/lang/vendor` directory.

Usage after installation
------------------------

[](#usage-after-installation)

This package will enable you to generate cookies in your browser, so you'll need to adapt your codes to take account of the different user choices.

Here are the cookies that will be created automatically in the session:

- `cookies_accepted`: This cookie will be created when the user accepts the cookies.
- `necessary_cookies`: This cookie will be created when the user accepts the necessary cookies.
- `analytics_cookies`: This cookie will be created when the user accepts the analytics cookies.
    - If user accepts the analytics cookies, the Google Analytics script will be added to the page. Make sure to add your Google Analytics ID in the `.env` file.
- `advertising_cookies`: This cookie will be created when the user accepts the advertising cookies.

if you want to check if the user has accepted the cookies, you can use the following code:

```
    @if(request()->cookie('cookies_accepted') == true)
        {{-- Your code here --}}
    @endif

```

License
-------

[](#license)

Hive Consent is open-sourced package licensed under the [MIT License](LICENSE).

Credits
-------

[](#credits)

- [Hivedrops](https://hivedrops.re) - Web Development Agency

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance40

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~4 days

Total

5

Last Release

655d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/51c428caf11ef6eec2d074b8fc1d76a0ffb12dfab1cd664efd0aacda414461ec?d=identicon)[Hivedrops](/maintainers/Hivedrops)

---

Top Contributors

[![Hoarau-Brian](https://avatars.githubusercontent.com/u/51639830?v=4)](https://github.com/Hoarau-Brian "Hoarau-Brian (25 commits)")

### Embed Badge

![Health badge](/badges/hivedrops-hive-consent/health.svg)

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

###  Alternatives

[spatie/laravel-honeypot

Preventing spam submitted through forms

1.6k6.0M60](/packages/spatie-laravel-honeypot)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

3651.8M3](/packages/sunspikes-clamav-validator)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)

PHPackages © 2026

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