1. Go to this page and download the library: Download netipar/laravel-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/ */
use NETipar\Consent\Facades\Consent;
$consentId = Consent::consentId(); // the id cookie of the current request, or null
$events = Consent::history($consentId); // Collection<int, ConsentLog>, oldest first
use Illuminate\Support\Facades\Schedule;
use NETipar\Consent\Models\ConsentLog;
Schedule::command('model:prune', ['--model' => [ConsentLog::class]])->daily();
use NETipar\Consent\Facades\Consent;
Consent::allows('analytics'); // bool — false until a valid decision exists; ; // bool — a decision for the current config version exists
Consent::decision(); // ConsentDecision { granted, version }
Consent::categories(); // list<Category> — key,
use NETipar\Consent\Facades\Consent;
use NETipar\OfficeLeads\Facades\OfficeLeads;
OfficeLeads::resolveAttributionConsentUsing(fn ($request) => Consent::allows('marketing', $request));