PHP code example of juniyasyos / nexaid-client

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

    

juniyasyos / nexaid-client example snippets


use Illuminate\Foundation\Auth\User as Authenticatable;
use Spatie\Permission\Traits\HasRoles;

class User extends Authenticatable
{
    use HasRoles;

    protected $fillable = [
        'iam_id',
        'name',
        'email',
        'status',
    ];
}

Route::middleware(['iam.auth:web'])->group(function () {
    Route::get('/dashboard', DashboardController::class);
});

'user_fields' => [
    'iam_id' => 'sub',
    'name' => 'name',
    'email' => 'email',
    'nip' => 'nip',
    'nik' => 'nik',
],
'identifier_field' => 'iam_id',

use Juniyasyos\IamClient\Events\IamAuthenticated;

Event::listen(IamAuthenticated::class, function ($event) {
    // $event->user
    // $event->payload
    // $event->guard
});
bash
php artisan vendor:publish --tag=iam-config
bash
php artisan migrate
bash
php artisan vendor:publish --tag=iam-views