Skip to content

Commit

Permalink
Merge pull request #6 from worksome/feature/docs
Browse files Browse the repository at this point in the history
docs: update usage
  • Loading branch information
owenvoke authored Apr 19, 2023
2 parents 25113ca + 3715dd4 commit dd7cc11
Showing 1 changed file with 10 additions and 25 deletions.
35 changes: 10 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,22 @@ The Laravel wrapper for the Onfido PHP API Client.
## Installation

Install using composer:
```

```shell
composer require worksome/laravel-onfido
```

In app.php in your Laravel application add the Service Provider under the providers array:
```
'providers' => [
...,
Worksome\Onfido\OnfidoServiceProvider::class,
],
```
Also add the Class Alias under the aliases array:
```
'aliases' => [
...,
'Onfido' => Worksome\Onfido\Facades\Onfido::class,
],
```
Add a onfido.php config file in your config directory with the following content:
```
<?php
Publish the configuration file with the following command:

return [
"api_key" => env("ONFIDO_API_KEY", "api_testing.default"),
];
```shell
php artisan vendor:publish --provider "Worksome\Onfido\OnfidoServiceProvider"
```

## Configuration

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

```
```dotenv
ONFIDO_API_KEY=api_sandbox.ABC...
```

Expand All @@ -45,10 +29,11 @@ ONFIDO_API_KEY=api_sandbox.ABC...
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.
Remember to import the Onfido facade, by adding `use Worksome\Onfido\Facades\Onfido;` at the top of your file.

To create an applicant and send a check:
```

```php
$applicant = Onfido::createApplicant([
'first_name' => 'John',
'last_name' => 'Doe',
Expand All @@ -66,7 +51,7 @@ The above is all that is required to create an applicant and send the applicant

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

```
```php
$applicant['id']
$onfido_check['id']
$onfido_check['status']
Expand Down

0 comments on commit dd7cc11

Please sign in to comment.