PHP code example of code16 / cookie-consent-js

1. Go to this page and download the library: Download code16/cookie-consent-js 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/ */

    

code16 / cookie-consent-js example snippets


php artisan vendor:publish --provider='Code16\CookieConsent\CookieConsentServiceProvider' --tag=assets --force

php artisan vendor:publish --provider="Code16\CookieConsent\CookieConsentServiceProvider" --tag=config

php artisan vendor:publish --provider="Code16\CookieConsent\CookieConsentServiceProvider" --tag=lang

[
    'categories' => [
        'system' => [
            '      'cookies' => []
                ]
            ]
        ],
        'analytics' => [
            'services' => [
                'google-analytics' => [
                    'cookies' => [
                        ['name' => '_ga', 'lifetime' => '2 years']
                    ]
                ]
            ]
        ],
    ]
];

[
    'manage_modal' => [
        'title' => 'Manage cookies',
        'description' => 'About cookies...',
        'categories' => [
            'system' => [
                'title' => 'System cookies',
                'description' => "Description text about system cookies",
            ],
            'analytics' => [
                'title' => 'Analytics cookies',
                'description' => "Description text about analytics cookies",
            ],
        ],
    ]
];