PHP code example of emilkitua / laravel-nida

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

    

emilkitua / laravel-nida example snippets


use EmilKitua\Nida\Nida;

$nida = app(Nida::class);
$userDetail = $nida->loadUser('XXXXXXXXX');
print_r($userDetail);

[
    'Nin' => 'XXXXXX',
    'Firstname' => 'XXXXXX',
    'Middlename' => 'XXXXXX',
    'Surname' => 'XXXXXX',
    'Othernames' => 'XXXXXX',
    'Sex' => 'XXXXXX',
    'Dateofbirth' => 'XXXXXX',
    'Residentregion' => 'XXXXXX',
    'Residentdistrict' => 'XXXXXX',
    'Residentward' => 'XXXXXX',
    'Residentvillage' => 'XXXXXX',
    'Residentstreet' => 'XXXXXX',
    'Residentpostcode' => 'XXXXXX',
    'Permanentregion' => 'XXXXXX',
    'Permanentdistrict' => 'XXXXXX',
    'Permanentward' => 'XXXXXX',
    'Permanentvillage' => 'XXXXXX',
    'Permanentstreet' => 'XXXXXX',
    'Birthcountry' => 'XXXXXX',
    'Birthregion' => 'XXXXXX',
    'Birthdistrict' => 'XXXXXX',
    'Birthward' => 'XXXXXX',
    'Nationality' => 'XXXXXX',
    'Phonenumber' => 'XXXXXX',
    'Maritalstatus' => 'XXXXXX',
    'Occupation' => 'XXXXXX',
    'Primaryschooleducation' => 'XXXXXX',
    'Primaryschooldistrict' => 'XXXXXX',
    'Primaryschoolyear' => 'XXXXXX',
    'Photo' => 'XXXXXX',
    'Signature' => 'XXXXXX',
    'Nationalidnumber' => 'XXXXXX',
    'Lastname' => 'XXXXXX'
]

echo $userDetail['Firstname']; // 'XXXXXX'
echo $userDetail->get('Middlename'); // 'XXXXXX'
echo $userDetail->Lastname; // 'XXXXXX'

imagepng($userDetail['Photo'], 'National_ID.png');
imagepng($userDetail['Signature'], 'Signature.png');

$userDetail = $nida->loadUser('xxxxxxxxxx', true);
print_r($userDetail);