New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

andrevalentin/laravel-onfido

A Laravel wrapper for the Onfido PHP client
170,030 4
Install
composer require andrevalentin/laravel-onfido
Latest Version:v5.1.0
PHP:^7.1.3 || ^8.0
Laravel:8
Older releases:7
License:MIT
Last Updated:Feb 17, 2022
Links: GitHub  ·  Packagist
Maintainer: andrevalentin

The Onfido Laravel Package

The Laravel wrapper for the Onfido PHP API Client.

Installation

Install using composer:

composer require andrevalentin/laravel-onfido

In app.php in your Laravel application add the Service Provider under the providers array:

'providers' => [
    ...,
    AndreValentin\Onfido\OnfidoServiceProvider::class,
],

Also add the Class Alias under the aliases array:

'aliases' => [
    ...,
    'Onfido'    => AndreValentin\Onfido\Facades\Onfido::class,
],

Add a onfido.php config file in your config directory with the following content:

<?php

return [
    "api_key" => env("ONFIDO_API_KEY", "api_testing.default"),
];

Configuration

Remember to add your Onfido API key to your .env file.

ONFIDO_API_KEY=api_sandbox.ABC...

Usage

I would always encourage anyone to use the official PHP package as reference, and this is simply a Laravel wrapper. However, I will provide an example on how to create an applicant.

Remeber to import the Onfido Facade, by adding use Onfido; at the top of your file.

To create an applicant and send a check:

$applicant = Onfido::createApplicant([
    'first_name' => 'John',
    'last_name' => 'Doe',
    'email' => 'johndoe@example.org',
]);

$onfido_check = Onfido::createCheck([
    'applicant_id' => $applicant['id'],
    'report_names' => ['right_to_work'],
    'applicant_provides_data' => true,
]);

The above is all that is required to create an applicant and send the applicant a right to work check via Onfido.

You can then consult the results of the check as an array:

$applicant['id']
$onfido_check['id']
$onfido_check['status']
$onfido_check['form_uri']

To see all possible return data check the official PHP package documentation over at https://github.com/onfido/api-php-client

Related Packages

worksome/laravel-onfido

A Laravel wrapper for the Onfido PHP client

459,056 1
avto-dev/identity-laravel

IDEntity for Laravel

31,538 3
filafly/filament-identity-column

A column for Filament Tables to which combines an avatar, name and description.

12,345 7
goldnead/statamic-identity-contracts

Identity foundation for Statamic addons: a stable Identity value object and reso...

7,009 0

Version History

Version Released PHP Laravel License
v5.1.0 ^7.1.3 || ^8.0 ^8.0 MIT
v5.0.0 ^7.1.3 || ^8.0 ^8.0 MIT
v4.0.1 ^8.0 MIT
v4.0.0 ^8.0 MIT
v3.0.0 ~7.22 MIT