PHP code example of veribenim / laravel

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

    

veribenim / laravel example snippets


use Veribenim\Laravel\VeribenimFacade as Veribenim;

public function store(Request $request)
{
    Veribenim::logFormConsent(
        formName:    'contact',
        consented:   $request->boolean('kvkk'),
        consentText: 'KVKK kapsamında verilerimin işlenmesini onaylıyorum.',
        metadata:    ['email' => $request->email]
    );
}

Veribenim::submitDsar(
    requestType: 'erasure',
    fullName:    $request->full_name,
    email:       $request->email,
    description: $request->description
);

use Veribenim\VeribenimClient;

class ContactController extends Controller
{
    public function __construct(private readonly VeribenimClient $veribenim) {}

    public function store(Request $request)
    {
        $this->veribenim->logFormConsent(
            formName:  'contact',
            consented: $request->boolean('kvkk'),
        );
    }
}

Route::middleware('veribenim.consent:analytics')->group(function () {
    Route::get('/dashboard', DashboardController::class);
});