yousign-laravel maintained by carminerumma
YouSignLaravel
It's a library for Laravel 7 and PHP7 Not tested on previous version.
Library to use YouSign API from doc (dev.yousign.com) with Laravel
Installation
You can install the package via composer:
composer require carminerumma/yousign-laravel
The service provider will automatically register itself.
You must publish the config file with:
php artisan vendor:publish --provider="CarmineRumma\YousignLaravel\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'),
'api_env' => env('YOUSIGN_API_ENV', 'production'), // ['production', 'staging']
];
Usage
Users
Lists all users:
use CarmineRumma\YousignLaravel\YousignLaravel;
$users = YousignLaravel::getUsers();
Procedure
Send a file:
use CarmineRumma\YousignLaravel\YousignLaravel;
$file = YousignLaravel::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 CarmineRumma\YousignLaravel\YousignLaravel;
$file = YousignLaravel::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();
License
The MIT License (MIT). Please see License File for more information.