PHP code example of christopheraseidl / livewire-cookie-consent
1. Go to this page and download the library: Download christopheraseidl/livewire-cookie-consent library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
christopheraseidl / livewire-cookie-consent example snippets
return [
'cookie_name' => 'cas_laravel_cookie_consent',
'cookies_to_delete' => [],
'consent_value' => 'yes',
'refuse_value' => 'no',
'enabled' => true,
'consent_cookie_lifetime' => 60 * 24 * 365,
'refuse_cookie_lifetime' => 60 * 24 * 30,
'available_locales' => ['en', 'es'],
];
// app/Http/Kernel.php
class Kernel extends HttpKernel
{
protected $middleware = [
// ...
\christopheraseidl\CookieConsent\CookieConsentMiddleware::class,
];
// ...
}
<x-cookie-policy />
//config/cookie-consent.php
return [
// ...
'cookies_to_delete' => ['delete_me', 'delete_me_also'],
];
bash
php artisan cookie-consent:install
bash
php artisan vendor:publish --provider="christopheraseidl\CookieConsent\CookieConsentServiceProvider" --tag="cookie-consent-config"
bash
php artisan vendor:publish --provider="christopheraseidl\CookieConsent\CookieConsentServiceProvider" --tag="cookie-consent-translations"
bash
php artisan vendor:publish --provider="christopheraseidl\CookieConsent\CookieConsentServiceProvider" --tag="cookie-consent-views"
bash
php artisan cookie-consent:uninstall