Configuration
During installation, you'll publish a configuration file for Cookie Notice to config/cookie-notice.php
. The contents of said file look like this:
<?php
return [
/*
|--------------------------------------------------------------------------
| Cookie
|--------------------------------------------------------------------------
|
| It's ironic, but this addon uses cookies to store if a user has consented
| to cookies or not, and which ones they've consented to. Don't worry
| though, no cookie is stored if the user doesn't consent.
|
*/
'cookie_name' => 'COOKIE_NOTICE',
/*
|--------------------------------------------------------------------------
| Consent Groups
|--------------------------------------------------------------------------
|
| Consent groups allow you to give your users the option to which cookies they'd
| like to enable and which cookies they'd prefer to keep disabled.
|
*/
'groups' => [
'Necessary' => [
'required' => true,
'toggle_by_default' => true,
],
'Statistics' => [
'required' => false,
'toggle_by_default' => false,
],
'Marketing' => [
'required' => false,
'toggle_by_default' => false,
],
],
];
-
cookie_name
defines the name of the cookie you wish to store the users' cookie preferences.
-
groups
is an array of consent groups. Feel free to update them however you want. The key is the name of the group, which will be displayed to the user. required
defines whether the user is absolutly required to accept cookies for that group. toggle_by_default
will automatically check the checkbox on the consent notice, however the user will be able to uncheck it if they want.