Skip to main content
Back to packages
1,499 GitHub stars

spatie/laravel-cookie-consent

View on GitHub

Description

Make your Laravel app comply with the crazy EU cookie law

This package adds a simple, customizable cookie consent message to your site. When the site loads, the banner appears and lets users consent to cookies. Once consent is given, the banner hides and stays hidden.

What this package does not:

  • Include an option to 'Decline' all cookies, which might be required.
  • Block trackers and cookies before consent. You need to handle this yourself.
  • Include options for different consent categories like "Necessary" or "Marketing".

To display the dialog all you have to do is include this view in your template:

//in your blade template
@include('cookie-consent::index')

This will render the following dialog that, when styled, will look very much like this one.

Recent Courses on Laravel Daily

Next.js Basics for Laravel Developers

11 lessons
58 min

How to Build Laravel 13 API From Scratch

30 lessons
1 h 23 min

How to Structure Laravel 13 Projects

16 lessons
1 h 32 min read

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.