PHPackages                             tylermenezes/legalesign-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. tylermenezes/legalesign-php

ActiveLibrary[API Development](/categories/api)

tylermenezes/legalesign-php
===========================

Library for working with the Legalesign API.

0.10(9y ago)54112ArtisticPHP

Since Mar 4Pushed 9y agoCompare

[ Source](https://github.com/tylermenezes/Legalesign-PHP)[ Packagist](https://packagist.org/packages/tylermenezes/legalesign-php)[ RSS](/packages/tylermenezes-legalesign-php/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

Legalesign-PHP
==============

[](#legalesign-php)

A PHP-based interface to Legalesign.

Use
---

[](#use)

Include it with Composer:

`composer require tylermenezes/legalesign-php`

### Set your credentials

[](#set-your-credentials)

You can view your API credentials at the bottom of [your user page](https://legalesign.com/acc/settings/). Non-sandboxed use currently requires a paid plan, but you can test your integration in the sandbox. (When in sandbox mode, you will only be able to send requests to five emails you specify on your profile page.)

You can set your credentials like so:

```
Legalesign\Api::credentials('ffffffffffffffffffffffffffff', '000000000000000000000000000000000000000000');
```

If you use Laravel, credentials will automatically be pulled from a `legalesign.php` config file, if one exists. The format of this file should be:

```
return [
    'userid' => 'ffffffffffffffffffffffffffffff',
    'secret' => '000000000000000000000000000000000000000000'
];
```

### Change API Base URL

[](#change-api-base-url)

For some reasons, some accounts do not work with `https://api.legalesign.com/api/v1`.

You can change your Base API URL by calling `apiBase()` method.

```
Legalesign\Api::apiBase('https://eu-api.legalesign.com/api/v1');
```

### Create a signer

[](#create-a-signer)

```
$me = new Legalesign\Signer;
$me->firstName = 'Tyler';
$me->lastName = 'Menezes';
$me->email = 'tylermenezes@protonmail.ch';
```

### Create a signing request

[](#create-a-signing-request)

```
$document = Legalesign\Document::create()
    ->name('Waiver of Liability')
    ->group('mygroup')
    ->addSigner($me)
    ->sendWithTemplatePdf('mytemplate');
```

The `Document::create()` method actually returns a `Document\SigningRequest` object, which will allow you to configure your signing request. As shown above, you should configure properties by chaining method calls with the names of the properties you'd like to set.

The following properties are supported:

- `groupId` (required): the ID of the group to which the document should belong. If you're not sure what this ID is, the easiest way to find it is to hover over your company name in the header. The group ID will be in the last part of the URL.
- `name` (required): the company name.
- `userId`: the ID of the user from which the document should be sent. You can leave this blank for the default.
- `appendLegalesignValidationInfo` (default true): If true, a page will be added to the document with audit logs.
- `autoArchive` (default true): Automatically archive the document after completion. This mostly just hides it from the dashboard.
- `signaturesOnAllPages` (default false): If true, show signatures on all pages. Otherwise, only show them on the last page.
- `certify` (default true): If true, Legalesign should certify the PDF. This is recommended.
- `signInOrder` (default true): If true, the second signer cannot sign until the first has signed, etc. Signing order is the order in which you add signers.
- `password` (default null): If set, the PDF will be password protected with the set password.
- `storePassword` (default false): If a password is set, this affects whether Legalesign saves the password.
- `footer`, `footerHeight`, `header`, `headerHeight` (all default null): If set, these control the footer and header.
- `pdfText` (default \[\]): If set, the PDF sender fields will be pre-filled according to these values.
- `signerText` (default \[\]): If set, the PDF signer fields will be pre-filled according to these values.

You can also add signers and cc'ers (people who will be cc'd on all emails) with the `addSigner` and `addCc` methods.

To actually send the document, end the chain with one of the following three methods:

- `sendWithHtml($html)`: Specifies the document to send in HTML, and sends it.
- `sendWithTemplateHtml($template)`: Specifies an HTML template to use for the document, and sends it.
- `sendWithTemplatePdf($template)`: Specifies a PDF template to use for the document, and sends it.

All of these methods return a `Document`, of which you should generally save the `id`.

### Get signer fields

[](#get-signer-fields)

```
$document = Legalesign\Document::find($documentId);
foreach ($document->signers as $signer) {
    $fields = $signer->getSignerFields();
}
```

The `getSignerFields()` method returns an associative array of all your signer fields. Refer below for the sample format:

```
[
    'key' => 'value'
]
```

### Retrieve an existing signing request, and try to download the executed agreement.

[](#retrieve-an-existing-signing-request-and-try-to-download-the-executed-agreement)

```
$document = Legalesign\Document::find('my-document-id');
if ($document->downloadReady) {
    file_put_contents('/tmp/test.pdf', $document->getPdf());
} else {
    echo 'Document is not yet ready!';
}
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 52.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~117 days

Total

5

Last Release

3301d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/173390?v=4)[Tyler Menezes](/maintainers/tylermenezes)[@tylermenezes](https://github.com/tylermenezes)

---

Top Contributors

[![tylermenezes](https://avatars.githubusercontent.com/u/173390?v=4)](https://github.com/tylermenezes "tylermenezes (9 commits)")[![jestillore](https://avatars.githubusercontent.com/u/3094154?v=4)](https://github.com/jestillore "jestillore (8 commits)")

### Embed Badge

![Health badge](/badges/tylermenezes-legalesign-php/health.svg)

```
[![Health](https://phpackages.com/badges/tylermenezes-legalesign-php/health.svg)](https://phpackages.com/packages/tylermenezes-legalesign-php)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k532.1M19.4k](/packages/laravel-framework)[statamic/cms

The Statamic CMS Core Package

4.8k3.5M923](/packages/statamic-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[smodav/mpesa

M-Pesa API implementation

16167.1k1](/packages/smodav-mpesa)[imdhemy/google-play-billing

Google Play Billing

491.4M5](/packages/imdhemy-google-play-billing)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
