PHPackages                             senses/laravel-gdpr - 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. senses/laravel-gdpr

ActiveLibrary

senses/laravel-gdpr
===================

Laravel package for under the hood management of GDPR permission cookies.

0.1.1(5y ago)192MITPHPPHP ^7.1

Since Oct 20Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Senses-Web-Solutions/laravel-gdpr)[ Packagist](https://packagist.org/packages/senses/laravel-gdpr)[ RSS](/packages/senses-laravel-gdpr/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

Senses Laravel GDPR
===================

[](#senses-laravel-gdpr)

Laravel package to handle management of cookies via type. Heavily inspired by Spatie's [laravel-cookie-consent](https://github.com/spatie/laravel-cookie-consent) package

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

[](#installation)

```
composer require senses/laravel-gdpr
```

In `config/app.php`

```
// Add to service providers array
Senses\Gdpr\GdprServiceProvider::class,

// Add to aliases array
'Gdpr' => Senses\Gdpr\GdprFacade::class,
```

Usage
-----

[](#usage)

### Backend

[](#backend)

In your layout file, include the `@gdprjs` directive somewhere inside your `` tag.

You can then use the directive `@gdpr('category')` which acts as an if statement based on whether or not the user has accepted the cookie.

You can publish the package's config to `config/gdpr.php` with `php artisan vendor:publish`.

```
php artisan vendor:publish --provider="Senses\Gdpr\GdprServiceProvider"
```

The default categories for cookies are:

```
'types' => [
    'necessary', 'functional', 'analytics', 'settings'
]
```

You can change this in your published config, along with the cookie name and lifetime.

You can disable the plugin by setting `GDPR_ENABLED` to `false` in your `.env.` file.

### Frontend

[](#frontend)

Provided the `@gdprjs` directive is present, you can manipulate the gdpr settings via javascript.

The package binds a `laravelGdpr` object to the `window` object. Allowing you to work with the package from there.

It's best to reload the page once you're done changing these settings in order for the user's configuration to come into effect.

The `laravelGdpr` object has two methods inside it:

`laravelGdpr.get()` will return the user's entire config.

`laravelGdpr.set(category, value)` accepts two parameters, `category` and `value`. `value` should be boolean.

The package is frontend-agnostic, allowing you to use your own CSS and JS to construct the GDPR permissions modal.

When one of your toggles or checkboxes is changed, you will need to call the `laravelGdpr.set()` method.

**Quick Example:**

```
document.querySelector('input[type="checkbox"]#third_party').addEventListener('click', function(e) {
    laravelGdpr.set('third_party', e.target.checked);
});
```

There is a full example Vue component available on [codesandbox](https://codesandbox.io/s/senses-gdpr-example-modal-el7dw?file=/src/components/GdprModal.vue)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.3% 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 ~308 days

Total

3

Last Release

1419d ago

Major Versions

0.1.1 → 1.0.0-rc12022-06-28

PHP version history (2 changes)0.1.0PHP ^7.1

1.0.0-rc1PHP ^7.0|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/42136c99644c6b8a8ea177aece5eb5120768caf367613394ad3d7d17a01662c6?d=identicon)[hjbdev](/maintainers/hjbdev)

![](https://avatars.githubusercontent.com/u/472542?v=4)[senses](/maintainers/senses)[@senses](https://github.com/senses)

---

Top Contributors

[![hjbdev](https://avatars.githubusercontent.com/u/30434619?v=4)](https://github.com/hjbdev "hjbdev (14 commits)")[![matyhaty](https://avatars.githubusercontent.com/u/454235?v=4)](https://github.com/matyhaty "matyhaty (1 commits)")

---

Tags

laravelpackagecookiegdpreucomplysenses

### Embed Badge

![Health badge](/badges/senses-laravel-gdpr/health.svg)

```
[![Health](https://phpackages.com/badges/senses-laravel-gdpr/health.svg)](https://phpackages.com/packages/senses-laravel-gdpr)
```

###  Alternatives

[spatie/laravel-cookie-consent

Make your Laravel app comply with the crazy EU cookie law

1.5k4.7M20](/packages/spatie-laravel-cookie-consent)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/laravel-cookie-consent

Register, configure and ask for cookies consent in a EU-compliant way.

489563.9k1](/packages/whitecube-laravel-cookie-consent)[retinens/laravel-cookie-consent

Make your Laravel app comply with the crazy EU cookie law

354.5k](/packages/retinens-laravel-cookie-consent)[statikbe/laravel-cookie-consent

Cookie consent modal for EU

213396.7k](/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.

17633.8k1](/packages/devrabiul-laravel-cookie-consent)

PHPackages © 2026

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