PHPackages                             elao/consent-bundle - 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. elao/consent-bundle

ActiveSymfony-bundle

elao/consent-bundle
===================

Consent Bundle for Symfony. Provides RGPD compliant consent toast.

213.9k↓100%[1 issues](https://github.com/Elao/ElaoConsentBundle/issues)[3 PRs](https://github.com/Elao/ElaoConsentBundle/pulls)PHP

Since Feb 22Pushed 1y ago4 watchersCompare

[ Source](https://github.com/Elao/ElaoConsentBundle)[ Packagist](https://packagist.org/packages/elao/consent-bundle)[ RSS](/packages/elao-consent-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Consent Bundle
==============

[](#consent-bundle)

This bundle provides a "cookies toast" allowing you to require user consent before using tracking scripts or cookies.

[![Blue](./doc/images/toast-blue.png)](./doc/images/toast-blue.png)

[![Green](./doc/images/toast-green.png)](./doc/images/toast-green.png)

[![Green](./doc/images/toast-yellow.png)](./doc/images/toast-yellow.png)

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

[](#installation)

```
composer require elao/consent-bundle

```

In your `bundles.php` files:

```
return [
+    Elao\Bundle\ConsentBundle\ElaoConsentBundle::class => ['all' => true],
];
```

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

[](#configuration)

By default, the bundle provide a single consent type called `default`.

You can replace this default consent by one or multiple custom consent:

```
elao_consent:
    consents:
        foobar:
            label: Consent to foobar
        barfoo:
            label: Consent to barfoo
```

You can also configure the cookie containing user consent:

```
elao_consents:
    cookie:
        name: "consent"
        ttl: 15552000 # 6 months
```

Usage
-----

[](#usage)

In Twig with default consents:

```
{% if has_user_consent() %}

        // your script requiring consent here

{% endif %}
```

With multiple consents:

```
{% if has_user_consent('foobar') %}

        // your script requiring consent here

{% endif %}
{% if has_user_consent('barfoo') %}

        // your script requiring consent here

{% endif %}
```

Overriding colors
-----------------

[](#overriding-colors)

In your CSS:

```
.elao-consent {
    --elao-consent-primary: #007bff;
    --elao-consent-primary-dark: #256cdf;
    --elao-consent-secondary: #dfebfa;
    --elao-consent-secondary-dark: #cadef8;
    --elao-consent-danger: #ef4055;
    --elao-consent-neutral: #eae8e8;
    --elao-consent-light: #fff;
    --elao-consent-dark: #252525;
}
```

SASS example:

```
.elao-consent {
    $elao-consent-base-color: #FFCA29;

    --elao-consent-primary: #{$elao-consent-base-color};
    --elao-consent-primary-dark: #{darken($elao-consent-base-color, 1%)};
    --elao-consent-secondary: #{lighten($elao-consent-base-color, 50%)};
    --elao-consent-secondary-dark: #{darken(lighten($elao-consent-base-color, 50%), 1%)};
}
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 Bus Factor1

Top contributor holds 63.6% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/156850a5601e6fe41cbc75ff2c4a4a78caf0502df9db8ec1165ec4370b7de616?d=identicon)[Elao](/maintainers/Elao)

---

Top Contributors

[![maximecolin](https://avatars.githubusercontent.com/u/606766?v=4)](https://github.com/maximecolin "maximecolin (21 commits)")[![sludovicdelys](https://avatars.githubusercontent.com/u/74900669?v=4)](https://github.com/sludovicdelys "sludovicdelys (9 commits)")[![benji07](https://avatars.githubusercontent.com/u/166890?v=4)](https://github.com/benji07 "benji07 (2 commits)")[![ogizanagi](https://avatars.githubusercontent.com/u/2211145?v=4)](https://github.com/ogizanagi "ogizanagi (1 commits)")

### Embed Badge

![Health badge](/badges/elao-consent-bundle/health.svg)

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

PHPackages © 2026

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