carminerumma/yousign-laravel

Package for using Yousign Api with Laravel > 7.x

dev-develop 2023-11-02 13:39 UTC

This package is auto-updated.

Last update: 2024-04-26 16:22:14 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

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.

Creator