1. Go to this page and download the library: Download cboxdk/laravel-risk 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/ */
cboxdk / laravel-risk example snippets
use Cbox\Risk\Facades\Risk;
use Cbox\Risk\ValueObjects\RiskContext;
$assessment = Risk::assess(RiskContext::fromRequest($request, action: 'register', attributes: [
'honeypot' => $request->input('nickname'), // an invisible field
'form_rendered_at' => $request->integer('rendered_at'),
]));
if ($assessment->atLeast(Outcome::Challenge)) {
// show a CAPTCHA,
final class GeoVelocitySignal implements Signal
{
public function key(): string { return 'geo.velocity'; }
public function evaluate(RiskContext $context): ?SignalResult
{
// return new SignalResult('geo.velocity', 30, 'impossible travel') or null
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.