PHP code example of itemvirtual / cookies-popup

1. Go to this page and download the library: Download itemvirtual/cookies-popup 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/ */

    

itemvirtual / cookies-popup example snippets


# file app/Http/Middleware/EncryptCookies.php
protected $except = [
    'analytical_cookies',
    'advertising_cookies',
    'recaptcha_cookies',
    'preferences_cookies',
];

->withMiddleware(function (Middleware $middleware) {
    $middleware->encryptCookies(except: [
        'analytical_cookies',
        'advertising_cookies',
        'recaptcha_cookies',
        'preferences_cookies',
    ]);
})
bash
php artisan vendor:publish --provider="Itemvirtual\CookiesPopup\CookiesPopupServiceProvider" --tag=config
bash
php artisan cookies-popup:generate-labels