PHP code example of lenius / laravel-altid

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

    

lenius / laravel-altid example snippets


use Lenius\LaravelAltid\AltIdAgeVerificationService;

$service = app(AltIdAgeVerificationService::class);

// Start with default claim (age_over_18)
$transaction = $service->start();

// Or specify a claim
$transaction = $service->start('age_over_21');

[
    'transaction_id'        => 'abc123',
    'authorization_url'     => 'av://?response_type=vp_token&...',  // deep-link for AltID app
    'test_app_url'          => 'https://app.test.tegnebog.dk/...',  // for testing
    'status_url'            => 'https://yourapp.com/api/altid/age/abc123/status',
    // ...
]

$transaction = $service->find($transactionId);

// $transaction['status']   => 'pending' | 'approved' | 'failed'
// $transaction['verified'] => true | false
bash
php artisan vendor:publish --tag="laravel-altid-config"
bash
php artisan vendor:publish --tag="laravel-altid-views"
php artisan vendor:publish --tag="laravel-altid-assets"