1. Go to this page and download the library: Download 3neti/hyperverge 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/ */
3neti / hyperverge example snippets
use LBHurtado\HyperVerge\Services\SelfieLivenessService;
$service = app(SelfieLivenessService::class);
$result = $service->verify($base64Image);
if ($result->isLive) {
// Selfie is live
}
use LBHurtado\HyperVerge\Services\FaceMatchService;
$service = app(FaceMatchService::class);
$result = $service->match($referenceImage, $selfieImage);
if ($result->isMatch) {
echo "Confidence: {$result->confidence}";
}
use LBHurtado\HyperVerge\Services\ResultsService;
$service = app(ResultsService::class);
$result = $service->fetch($sessionId);
echo $result->applicationStatus;
use LBHurtado\HyperVerge\Traits\HasFaceVerification;
// Add trait to your model
class User extends Model implements HasMedia
{
use InteractsWithMedia, HasFaceVerification;
}
// Enroll reference selfie
$user->enrollFace(
selfie: $request->file('selfie'),
checkLiveness: true,
metadata: ['enrolled_at' => now(), 'ip' => $request->ip()]
);
if ($user->hasReferenceSelfie()) {
// User can verify by face
}
// Get statistics
$stats = $user->getFaceVerificationStats();
echo "Success rate: {$stats['success_rate']}%";
use LBHurtado\HyperVerge\Actions\Document\GenerateVerificationQRCode;
// Generate QR code with verification URL
$qrData = GenerateVerificationQRCode::run(
url: 'https://yourapp.com/verify/campaign-uuid/transaction-id',
size: 300,
margin: 10
);
// Returns:
// [
// 'data_uri' => 'data:image/png;base64,...', // For embedding in images
// 'file_path' => '/tmp/qr_abc123.png', // Physical file path
// 'url' => 'https://...', // Original URL
// 'size' => 300, // QR dimensions
// 'margin' => 10, // QR margin
// ]
use LBHurtado\HyperVerge\Actions\Document\AddQRWatermarkToPDF;
// Add QR code to PDF (bottom-right corner by default)
$watermarkedPdf = AddQRWatermarkToPDF::run(
pdfPath: $signedPdfPath,
qrCodePath: $qrData['file_path']
);
// With custom options
$watermarkedPdf = AddQRWatermarkToPDF::run(
pdfPath: $signedPdfPath,
qrCodePath: $qrData['file_path'],
page: -1, // -1 = last page, 0 = all pages, 1+ = specific page
position: 'bottom-right',
size: 100, // QR size in pixels
opacity: 100 // 0-100% opacity
);
use LBHurtado\HyperVerge\Actions\Document\MarkDocumentWithKYC;
// Signs document, adds QR watermark, stores in media library
$result = MarkDocumentWithKYC::run(
model: $submission,
transactionId: $transactionId,
additionalMetadata: [
'signer' => $submission->name,
'purpose' => 'Identity Verification',
],
tile: 1, // Signature position (1-9 for multi-signer)
logoPath: public_path('images/logo.png')
);
// Returns:
// [
// 'stamp' => $signatureMark, // Media object for signature stamp
// 'signed_document' => $signedDoc, // Media object for signed PDF with QR
// ]
// config/hyperverge.php
'qr_code' => [
'enabled' => true,
'default_size' => 300,
'margin' => 10,
'error_correction' => 'H', // L, M, Q, H (7%, 15%, 25%, 30%)
],
'document_signing' => [
'qr_watermark' => [
'enabled' => true,
'position' => 'bottom-right', // Any 9 positions supported
'size' => 100, // QR size in pixels (~0.33 inches at 300 DPI)
'page' => -1, // -1 = last page, 0 = all, 1+ = specific
'opacity' => 100, // 0-100% opacity
],
],