PHPackages                             eorplatform/laravel-pandadoc - 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. eorplatform/laravel-pandadoc

ActiveLibrary[API Development](/categories/api)

eorplatform/laravel-pandadoc
============================

Laravel package for dealing with PandaDoc API e-signature platform

1.0.12(2y ago)011MITPHPPHP ^8.1

Since Nov 10Pushed 2y ago2 watchersCompare

[ Source](https://github.com/eorplatform/laravel-pandadoc)[ Packagist](https://packagist.org/packages/eorplatform/laravel-pandadoc)[ Docs](https://github.com/eorplatform/laravel-pandadoc)[ RSS](/packages/eorplatform-laravel-pandadoc/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (9)Versions (4)Used By (0)

Laravel PandaDoc
================

[](#laravel-pandadoc)

This package is aimed for using the PandaDoc API with the Laravel. It provides a database table where you can store the responses from the documents and create a e-signature workflow for your app using the PandaDoc API.

Install
-------

[](#install)

Install using composer

```
composer require eorplatform/laravel-pandadoc
```

After you install the package, simply run the following command

```
php artisan laravel-pandadoc:install
```

Using the code above, that command will:

- publish the config file
- publish the migrations
- ask if migrations should be run now

Usage scenario
--------------

[](#usage-scenario)

Imagine you want to integrate the e-signature workflow for your app and you are using PandaDoc as your e-signature provider. With this package you can easily communicate with the API, using the PandaDoc templates and create the functionality on your website as you wish.

For example you can initiate signing of the contract like this:

```
$pandaApi = PandaDoc::addRecipient(
    'johndoe@example.com', // email
    'John', // First name
    'Doe', // Last name
    'CEO', // Role
    1, // his signing order)
    ->addRecipient(
    'peterfoe@example.com',
    'Peter',
    'Foe',
    'CTO',
    2)
    ->addToken('Client', 'AnnexNumber', 'A') // Your dynamic variable inside the PandaDoc templates
    ->addToken('Document', 'EffectiveDate', now()->format('F jS, Y'))
    ->createDocumentFromTemplate('My new MSA Annex', 'panda_doc_template_id'); // First param is name and the other is your PandaDoc template ID

// You can then store the response in your database related model
$pandaDocument =
            MyModel::pandaDocDocument()->create([
                'name' => 'My new MSA Annex',
                'document_id' => $pandaApi['document_id'],
                'template_id' => $pandaApi['template_id'],
                'tokens' => $pandaApi['tokens'],
                'recipients' => $pandaApi['recipients'],
                'invite_expire_at' => now()->addDays(config('panda-doc.invitation_expire_after_days'))
            ]);

// We are also using the spatie/status package so you can set the status like that
$pandaDocument->setStatus($pandaApi['status']);
```

Utilizing webhooks from PandaDoc
--------------------------------

[](#utilizing-webhooks-from-pandadoc)

Under the hood, this package relies on and installs the spatie/laravel-webhook-client for you. The only thing you need to do is to run:

```
php artisan vendor:publish --provider="Spatie\WebhookClient\WebhookClientServiceProvider" --tag="webhook-client-config"
```

Which will basically publish the config file for the webhooks package.

### Configuring the webhooks

[](#configuring-the-webhooks)

This is the contents of the file that will be published at `config/webhook-client.php`:

```
