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

Laravel 13 Starter Kit Teams and Customizations

10 lessons
33 min

Queues in Laravel 13

18 lessons
1 h 12 min read

How to Structure Laravel 13 Projects

16 lessons
1 h 32 min read