PHP code example of digifactory / laravel-cookie-consent

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

    

digifactory / laravel-cookie-consent example snippets


CookieConsent::forNecessary();
CookieConsent::forPreferences();
CookieConsent::forStatistics();
CookieConsent::forMarketing();

app('cookie-consent')->forNecessary();
app('cookie-consent')->forPreferences();
app('cookie-consent')->forStatistics();
app('cookie-consent')->forMarketing();



namespace DigiFactory\CookieConsent\Contracts;

interface ConsentProvider
{
    public function forNecessary(): bool;

    public function forPreferences(): bool;

    public function forStatistics(): bool;

    public function forMarketing(): bool;
}



return [
    /**
     * By default this package uses Cookiebot to determine if certain
     * types of cookies are allowed. Of course you can use a provider
     * of your own, your provider should implement the ConsentProvider
     * interface.
     */
    'provider' => \DigiFactory\CookieConsent\Providers\Cookiebot::class,
];
 bash
php artisan vendor:publish --provider="DigiFactory\CookieConsent\CookieConsentServiceProvider" --tag="config"