LaravelPackages.net
Acme Inc.
Toggle sidebar
w01ki3/cookie-consent

Laravel uygulamaları için KVKK(TR) ve GDPR(AB) uyumlu çerez onay paketi.

36
2
v1.1.1
About w01ki3/cookie-consent

w01ki3/cookie-consent is a Laravel package for laravel uygulamaları için kvkk(tr) ve gdpr(ab) uyumlu çerez onay paketi.. It currently has 2 GitHub stars and 36 downloads on Packagist (latest version v1.1.1). Install it with composer require w01ki3/cookie-consent. Discover more Laravel packages by w01ki3 or browse all Laravel packages to compare alternatives.

Last updated

cookie-consent

Take control of the cookie policy warning for your Laravel projects with this package.
Record in the database whether the user accepts or rejects the cookie policy.
User activity is recorded along with masked IP address information.
You can customize it.
You can also add different language options. (Currently, Turkish and English are included in the package.)

Installation steps

1. Install the package via Composer:

composer require w01ki3/cookie-consent

2. Publish the package resources

php artisan vendor:publish --provider="w01ki3\CookieConsent\CookieConsentServiceProvider"

3. Create a table to transfer the records to the database.

php artisan migrate

4. If you don't have a csrf token, please add it to the page.

<meta name="csrf-token" content="{{ csrf_token() }}">

5. Add styles in the <head> section:

{!! CookieConsent::styles() !!}

6. Add scripts before closing </body>:

{!! CookieConsent::scripts() !!}

Cookie settings can be managed from the config/cookie-consent.php file

'cookie_categories' => [
    'necessary' => [
        'enabled' => true,
        'locked' => true,
    ],
    'analytics' => [
        'enabled' => env('COOKIE_CONSENT_ANALYTICS', true),
        'locked' => false,
        'js_action' => 'loadGoogleAnalytics',
    ],
    'marketing' => [
        'enabled' => env('COOKIE_CONSENT_MARKETING', true),
        'locked' => false,
        'js_action' => 'loadFacebookPixel',
    ],
    'preferences' => [
        'enabled' => env('COOKIE_CONSENT_PREFERENCES', true),
        'locked' => false,
    ],
]

Then you will see an image like the one below on your screen.
Demo

The recorded log table is as follows:
table name : cookie_consent_logs

| id | ip_address | user_agent | action | preferences | url | | ----- | ---------- | ------------ | ------- | -------------- | ---- | bigint | varchar(255) | text | varchar(255) | json | varchar(255) | 1 | 255.255.255.*** | Mozil.... | accepted | {"analytics": true,"marketing": true,"necessary": true,"preferences": true} | www.project.test |

Comments