You can install the package via composer:
composer require alexis-riot/laravel-yousign
The service provider will automatically register itself.
You must publish the config file with:
php artisan vendor:publish --provider="AlexisRiot\Yousign\YousignServiceProvider" --tag="config"
This is the contents of the config file that will be published at config/yousign.php
:
return [
'api_key' => env('YOUSIGN_API_KEY', 'production'), // ['production', 'staging']
'api_env' => env('YOUSIGN_API_ENV'),
];
Lists all users:
use AlexisRiot\Yousign\Facades\Yousign;
$users = Yousign::getUsers();
Send a file:
use AlexisRiot\Yousign\Facades\Yousign;
$file = Yousign::createFile([
"name" => "devis.pdf",
"content" => "JVBERi0xLjUKJb/3ov4KNiA...",
]);
Create a procedure:
The creation of a procedure is fully dynamic, you can add multiple members and multiple files.
use AlexisRiot\Yousign\Facades\Yousign;
use AlexisRiot\Yousign\YousignProcedure;
$file = Yousign::createFile([
"name" => "devis.pdf",
"content" => "JVBERi0xLjUKJb/3ov4KNiA...",
]);
$procedure = new YousignProcedure();
$procedure
->withName("My procedure")
->withDescription("The description of my procedure")
->addMember([
'firstname' => "Alexis",
'lastname' => "Riot",
'email' => "contact@alexisriot.fr",
'phone' => "+33 600000000",
], [$file])
->send();
The MIT License (MIT). Please see License File for more information.