mintrox / cookieconsent

CookieConsent for Laravel with Opt-In


Mintrox Cookie-Consent (OPT-IN)

Mintrox Cookie-Consent is Cookie-Consent for the framework Laravel, it fulfills the requirements of the new EU law.

For Frontend we use bootstrap, fontawesome and jQuery


Use composer to install the package

composer require mintrox/cookieconsent

Some little adjsutments is required done by your self

Directly above the body closing tag add

// resources/views/layouts/app.blade.php (or your custom main layout)
<div id="mintrox-cookie-consent-banner"></div>

Directly under the asset include from laravel (in head tag) add

// resources/views/layouts/app.blade.php (or your custom main layout)
<script src="{{ asset('vendor/mintrox/CookieConsent/public/js/cookie-consent-banner.js') }}" defer></script>

After that publish the vendor assets by execute

 php artisan vendor:publish --tag=public

Finally you need to run the migration with

php artisan migrate


Now you have to create a user who should have the authorization to adjust CookieSettings. This can be done by execute our command.

We use laravel frontend authentication, so create an account and remember the uid, which you then enter in the command

 php artisan mintrox:cookieconsent:adduser

Now login in the Frontend and visit 

Cookie Groups

Here you can create cookie groups, these contain cookies. These are shown in the first level in the frontend modal and can be expanded by accordion.

Cookie groups contain a name and a description


Here you can create cookies, these can contain "Cookie Information" and "JS Source". These are shown in the accordion from the Cookie Groups.

Cookies contain a "Cookie Group", a name and two checkboxes

  • Should the cookie be active per default?
  • Strictly necessary cookies (These cookies are essential for you to browse the website and use its features, such as accessing secure areas of the site. Cookies that allow web shops to hold your items in your cart while you are shopping online are an example of strictly necessary cookies. These cookies will generally be first-party session cookies. While it is not required to obtain consent for these cookies, what they do and why they are necessary should be explained to the user.)

Cookie Information

Here you can add "Cookie Information" these are shown in a second accordion under the "Cookies". The "Cookie Information" provides information for the user f.e. for what the cookie is used.

Cookie Information contain a "Cookie", a title and a description

JS Sources

Here you can add "JS Sources" they are not shown in the frontend.
Here you can add f.e. the script code for Google Analytics, the script will only included when the user accepts the parent cookie.

"JS Sources" contain a "Cookie", a title and a JS Code which must include the script tag