Have you accessed a site and see a pop asking you to accept cookies? Do you know what it is for?
It is enforced by this EU Law (Cookies and similar technologies).
There are many ways to implement this pop up in your laravel application, but a simple one is laravel-cookie-consent from spatie (of course).
It is quite simple to use. (Also check the documentation)
Steps
Install the package
composer require spatie/laravel-cookie-consent
Use this in your blade file
@include('cookie-consent::index')
This will give you just a basic pop up with text
Your experience on this site will be improved by allowing cookies. Allow Cookies
You can customize this message and change your button. View the documentation to customize.
Note
It's always best to consult a lawyer to know what content to show on your website that obeys the EU Law
This is a basic article 😊
Top comments (2)
Cool package! I will be using it in my next projects.
Great!