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

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

apility/netflex-cookie-consent
==============================

Cookie consent modal for EU for use with Netflex SDK

v1.1.2(9mo ago)0915↑50%MITJavaScriptPHP ^7.0|^8.0

Since Oct 27Pushed 9mo agoCompare

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

READMEChangelog (4)Dependencies (2)Versions (8)Used By (0)

Show a Cookie consent modal on your Laravel application
=======================================================

[](#show-a-cookie-consent-modal-on-your-laravel-application)

The package includes a script &amp; styling for a cookie banner and a modal where the visitor can select his/her cookie preferences.

This package is mainly based on the one from spatie:

With the only exception that you can choose which cookies you enable. This only works when Google Tag Manager is correctly configured (some regex config based on the value set in the cookie).

- [Upgrading](upgrading.md)
- [Installation](#installation)
- [Usage](#usage)
- [Customising the dialog texts](#customising-the-dialog-texts)
    - [Customising the dialog contents](#customising-the-dialog-contents)
    - [Publishing](#publishing)
        - [Config](#config)
        - [Translations](#translations)
        - [Views](#views)
- [Configure Google Tag Manager](#configure-google-tag-manager)
- [Security](#security)
- [License](#license)

Upgrading
---------

[](#upgrading)

You can find our upgrading guides [here](upgrading.md).

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

[](#installation)

You can install the package via composer:

```
composer require apility/netflex-cookie-consent
```

The package will automatically register itself.

First of all **you need to** publish the javascript and css files:

```
php artisan vendor:publish --provider="Statikbe\CookieConsent\CookieConsentServiceProvider" --tag="public"
```

Include the css/cookie-consent.css into your base.blade.php or any other base template you use.

```

```

The javascript file is included in the cookie snippet and will be added at the end of your body.

Usage
-----

[](#usage)

Instead of including a snippet in your view, we will automatically add it. This is done using middleware using two methods:

1. The first option: include it in your entire project using the kernel:

```
// app/Http/Kernel.php

class Kernel extends HttpKernel
{
    protected $middleware = [
        // ...
        \Statikbe\CookieConsent\CookieConsentMiddleware::class,
    ];

    // ...
}
```

2. The second option: include it as a route middleware and add this to any route you want.

```
// app/Http/Kernel.php

class Kernel extends HttpKernel
{
    // ...

    protected $routeMiddleware = [
        // ...
        'cookie-consent' => \Statikbe\CookieConsent\CookieConsentMiddleware::class,
    ];
}

// routes/web.php
Route::group([
    'middleware' => ['cookie-consent']
], function(){
    // ...
});
```

This will add `cookieConsent::index` to the content of your response right before the closing body tag.

Customising the dialog texts
----------------------------

[](#customising-the-dialog-texts)

If you want to modify the text shown in the dialog you can publish the lang-files with this command:

```
php artisan vendor:publish --provider="Statikbe\CookieConsent\CookieConsentServiceProvider" --tag="lang"
```

This will publish this file to `resources/lang/vendor/cookieConsent/en/texts.php`.

```
return [
    'alert_title' => 'Deze website gebruikt cookies',
    'setting_analytics' => 'Analytische cookies',
];
```

If you want to translate the values to, for example, English, just copy that file over to `resources/lang/vendor/cookieConsent/fr/texts.php` and fill in the English translations.

### Customising the dialog contents

[](#customising-the-dialog-contents)

If you need full control over the contents of the dialog. You can publish the views of the package:

```
php artisan vendor:publish --provider="Statikbe\CookieConsent\CookieConsentServiceProvider" --tag="views"
```

This will copy the `index` view file over to `resources/views/vendor/cookieConsent`.

The `cookie-settings` view file is just a snippet you need to place somewhere onto your page. Most preferably in the footer next to the url of your cookie policy.

```
@lang('cookie-consent::texts.alert_settings')
```

This gives your visitor the opportunity to change the settings again.

### Publishing

[](#publishing)

#### Config

[](#config)

```
php artisan vendor:publish --provider="Statikbe\CookieConsent\CookieConsentServiceProvider" --tag="config"
```

This is the contents of the published config-file: This will read the policy urls from your env.

```
return [
    'cookie_key' => '__cookie_consent',
    'cookie_domain' => env('SESSION_DOMAIN'),
    'cookie_value_analytics' => 'analytics',
    'cookie_value_marketing' => 'marketing',
    'cookie_value_both' => 'all',
    'cookie_value_none' => 'none',
    'cookie_expiration_days' => '365',
    'gtm_event' => 'cookie_refresh',
    'ignored_paths' => [],
    'policy_url_en' => env('COOKIE_POLICY_URL_EN', null),
    'policy_url_fr' => env('COOKIE_POLICY_URL_FR', null),
    'policy_url_nl' => env('COOKIE_POLICY_URL_NL', null),
];
```

You can customize some settings that work with your GTM.

#### Don't show modal on cookie policy page or other pages

[](#dont-show-modal-on-cookie-policy-page-or-other-pages)

If you don't want the modal to be shown on certain pages you can add the relative url to the ignored paths setting. This also accepts wildcards (see the Laravel `Str::is()` [helper](https://laravel.com/docs/9.x/helpers#method-str-is)).

```
'ignored_paths => ['/en/cookie-policy', '/api/documentation*'];

```

#### Translations

[](#translations)

```
php artisan vendor:publish --provider="Statikbe\CookieConsent\CookieConsentServiceProvider" --tag="lang"
```

#### Views

[](#views)

```
php artisan vendor:publish --provider="Statikbe\CookieConsent\CookieConsentServiceProvider" --tag="views"
```

Configure Google Tag Manager
----------------------------

[](#configure-google-tag-manager)

All the steps to configure your Google Tag Manager can be found [here](docs/google-tag-manager.md).

Configure Google Tag Manager with consent mode v2
-------------------------------------------------

[](#configure-google-tag-manager-with-consent-mode-v2)

All the steps to configure your Google Tag Manager with consent mode v2 can be found [here](docs/google-tag-manager-consentmode.md).

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance58

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% 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 ~205 days

Recently: every ~256 days

Total

6

Last Release

274d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/302a7896c289b5381b87e0777b9eb3b1f475ee8333f471b0e65e9b1202fc6159?d=identicon)[olavoyen](/maintainers/olavoyen)

---

Top Contributors

[![olavoyen](https://avatars.githubusercontent.com/u/3416810?v=4)](https://github.com/olavoyen "olavoyen (10 commits)")[![cathrinevaage](https://avatars.githubusercontent.com/u/8112742?v=4)](https://github.com/cathrinevaage "cathrinevaage (1 commits)")

---

Tags

laravelcookiegdprnetflex

### Embed Badge

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

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

###  Alternatives

[statikbe/laravel-cookie-consent

Cookie consent modal for EU

213396.7k](/packages/statikbe-laravel-cookie-consent)[watson/active

Laravel helper for recognising the current route, controller and action

3253.6M14](/packages/watson-active)[laragear/preload

Effortlessly make a Preload script for your Laravel application.

119363.5k](/packages/laragear-preload)[glhd/conveyor-belt

14797.0k](/packages/glhd-conveyor-belt)[dragon-code/pretty-routes

Pretty Routes for Laravel

10058.7k4](/packages/dragon-code-pretty-routes)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)

PHPackages © 2026

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