### Install Laravel Sign Pad
Source: https://github.com/creagia/laravel-sign-pad/blob/main/README.md
Installs the Laravel Sign Pad package using Composer and publishes necessary configuration and migration files.
```bash
composer require creagia/laravel-sign-pad
php artisan sign-pad:install
```
--------------------------------
### Retrieve Signature Paths (PHP)
Source: https://github.com/creagia/laravel-sign-pad/blob/main/README.md
Demonstrates how to access signature-related paths using the Eloquent relation. It shows how to get the signature image path and the signed document path.
```php
echo $myModel->signature->getSignatureImagePath();
echo $myModel->signature->getSignedDocumentPath();
```
--------------------------------
### Customize Signature Pad Component (HTML)
Source: https://github.com/creagia/laravel-sign-pad/blob/main/README.md
Provides an example of customizing the signature pad component's appearance and behavior using HTML attributes. This includes setting border color, CSS classes for the pad and buttons, button text, and disabling the submit button without a signature.
```html
```
--------------------------------
### Publish Sign Pad Assets
Source: https://github.com/creagia/laravel-sign-pad/blob/main/README.md
Publishes the JavaScript assets for the sign pad functionality to the public vendor directory.
```bash
php artisan vendor:publish --tag=sign-pad-assets
```
--------------------------------
### Publish Sign Pad Assets
Source: https://github.com/creagia/laravel-sign-pad/blob/main/UPGRADING.md
Deletes and re-publishes the Javascript assets for the sign pad. This command ensures that the latest frontend assets are available in the public vendor directory.
```Bash
php artisan vendor:publish --tag=sign-pad-assets
```
--------------------------------
### Prepare Model for Signature
Source: https://github.com/creagia/laravel-sign-pad/blob/main/README.md
Prepares an Eloquent model to be signed by using the RequiresSignature trait and implementing the CanBeSigned contract.
```php
```
--------------------------------
### Generate SSL Certificate (Bash)
Source: https://github.com/creagia/laravel-sign-pad/blob/main/README.md
Illustrates the command to generate a self-signed SSL certificate using OpenSSL. This certificate is used for certifying PDFs with TCPDF.
```bash
cd storage/app
openssl req -x509 -nodes -days 365000 -newkey rsa:1024 -keyout certificate.crt -out certificate.crt
```
--------------------------------
### Configure PDF Generation with Signature
Source: https://github.com/creagia/laravel-sign-pad/blob/main/README.md
Configures a model to generate PDF documents with signatures, defining template options and signature positions.
```php
```
--------------------------------
### HTML Form for Signature
Source: https://github.com/creagia/laravel-sign-pad/blob/main/README.md
An HTML form that includes a signature pad component and submits the signature to the model's signature route.
```html
```
--------------------------------
### Update Configuration Values
Source: https://github.com/creagia/laravel-sign-pad/blob/main/UPGRADING.md
Modifies the configuration file to include new settings and rename existing ones. Specifically, it updates the disk name for storing signatures and renames `store_path` to `signatures_path`.
```PHP
/**
* The disk on which to store signature images. Choose one or more of
* the disks you've configured in config/filesystems.php.
*/
'disk_name' => env('SIGNATURES_DISK', 'local'),
/**
* Path where the signature images will be stored.
*/
'signatures_path' => 'signatures',
/**
* Path where the documents will be stored.
*/
'documents_path' => 'signed_documents',
```
--------------------------------
### Update SignatureDocumentTemplate for Multiple Positions
Source: https://github.com/creagia/laravel-sign-pad/blob/main/UPGRADING.md
Refactors the `SignatureDocumentTemplate` to accommodate multiple signature positions. This involves changing the signature position parameters from individual values to an array of `SignaturePosition` objects.
```PHP
use Creagia\LaravelSignPad\SignatureDocumentTemplate;
use Creagia\LaravelSignPad\Templates\PdfDocumentTemplate;
public function getSignatureDocumentTemplate(): SignatureDocumentTemplate
{
return new SignatureDocumentTemplate(
signaturePage: 1,
signatureX: 20,
signatureY: 25,
outputPdfPrefix: 'document', // optional
template: new PdfDocumentTemplate(storage_path('pdf/template.pdf')),
);
}
```
```PHP
use Creagia\LaravelSignPad\Templates\PdfDocumentTemplate;
use Creagia\LaravelSignPad\SignatureDocumentTemplate;
use Creagia\LaravelSignPad\SignaturePosition;
public function getSignatureDocumentTemplate(): SignatureDocumentTemplate
{
return new SignatureDocumentTemplate(
outputPdfPrefix: 'document', // optional
template: new PdfDocumentTemplate(storage_path('pdf/template.pdf')), // Uncomment for PDF template
signaturePositions: [
new SignaturePosition(
signaturePage: 1,
signatureX: 20,
signatureY: 25,
),
new SignaturePosition(
signaturePage: 2,
signatureX: 25,
signatureY: 50,
),
]
);
}
```
--------------------------------
### Delete Signature (PHP)
Source: https://github.com/creagia/laravel-sign-pad/blob/main/README.md
Shows how to delete a signature associated with a model using the `deleteSignature()` method.
```php
echo $myModel->deleteSignature();
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.