PHP code example of jeffersongoncalves / laravel-zapsign
1. Go to this page and download the library: Download jeffersongoncalves/laravel-zapsign library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jeffersongoncalves / laravel-zapsign example snippets
use JeffersonGoncalves\ZapSign\Exceptions\RateLimitException;
use JeffersonGoncalves\ZapSign\Exceptions\ZapSignException;
try {
ZapSign::document('missing');
} catch (RateLimitException $e) {
$e->retryAfter; // seconds
} catch (ZapSignException $e) {
$e->getMessage(); // ZapSign's `detail`/`message`
$e->getCode(); // HTTP status
$e->errors(); // decoded error body
}
use JeffersonGoncalves\ZapSign\Models\Document;
$documents = Document::query()->forModel($contract)->with('signers')->get();
$document->isSigned();
$document->isRefused();
$document->documentable; // the model you linked
Document::query()->where('status', Document::STATUS_PENDING)->get();
use JeffersonGoncalves\ZapSign\Jobs\CreateDocument;
use JeffersonGoncalves\ZapSign\Jobs\SyncDocument;
// Send a file (local path, or a path on any filesystem disk — S3 path: 'contracts/42.pdf', // .pdf or .docx
disk: 's3',
);
// Or with url_pdf / a template
CreateDocument::dispatch(['template_id' => '...', 'signer_name' => 'Client'], $contract, fromTemplate: true);
// Refresh a document (and its signers) from the API
SyncDocument::dispatch($token);
public function handle(): void
{
try {
ZapSign::createDocument([...]);
} catch (RateLimitException $e) {
$this->release($e->retryAfter);
}
}