PHP code example of onsefy / validate-user-laravel

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

    

onsefy / validate-user-laravel example snippets


'providers' => [
// ...
OnSefy\Laravel\OnSefyProvider::class,
],

'aliases' => [
// ...
'OnSefy' => OnSefy\Laravel\Facades\OnSefy::class,
],

$response = OnSefy::validateUser([
'email' => '[email protected]',
'phone' => '+13434128780',
'ip' => '103.209.253.36',
'name' => 'John Doe',
'user_agent' => 'mozilla/5.0 (macintosh; intel mac os x 10.15; rv:136.0) gecko/20100101 firefox/136.0',
]);

if ($response['status']) {
// Take action based on risk score or level
$risk = $response['summary']['risk_score'];
$risk_level = $response['summary']['risk_level'];

}
bash
php artisan vendor:publish --tag=onsefy-config