- How do I integrate handwritten signatures into my Laravel Eloquent models?
- Add the `RequiresSignature` trait and implement the `CanBeSigned` contract to your model. The package provides a Blade component (`<x-creagia-signature-pad />`) for capturing signatures, which you can embed in forms. The signature is automatically linked to the model via UUID.
- Can I generate certified PDFs with this package, and what’s required?
- Yes, the package integrates with TCPDF to generate certified PDFs. You’ll need OpenSSL configured for certificate generation, which adds DevOps overhead. Ensure your PHP version (8.2–8.5) supports TCPDF’s requirements. Legal validation is recommended for compliance (e.g., eIDAS).
- What Laravel and PHP versions does creagia/laravel-sign-pad support?
- The package supports Laravel 11–13 and PHP 8.2–8.5. Downgrading or upgrading outside these ranges may require manual adjustments or package updates. Always check the [GitHub releases](https://github.com/creagia/laravel-sign-pad/releases) for compatibility.
- How do I configure storage for signatures and PDFs?
- Use the published `config/sign-pad.php` to set the disk (local, S3, etc.) and paths for storing signatures and documents. The package leverages Laravel’s filesystem, so ensure your storage backend is properly configured in `config/filesystems.php`.
- Will this package conflict with my existing frontend asset pipeline (e.g., Vite or Webpack)?
- The package publishes JS assets to `public/vendor/sign-pad/`, which may conflict with modern asset pipelines. If using Vite or Webpack, manually copy the assets or configure your pipeline to ignore the published directory. For SPAs, consider server-side rendering for the signature pad.
- How do I add multiple signatures to a single PDF document?
- Use the `SignaturePosition` class in your model’s `getSignatureDocumentTemplate()` method to define multiple signature positions. Each position can be linked to a different field or model. Test edge cases like partial signatures or page breaks to ensure layout consistency.
- What happens if TCPDF fails to generate a certified PDF?
- The package does not include fallback logic by default, so TCPDF failures will halt PDF generation. Plan for this by either implementing a retry mechanism, defaulting to non-certified PDFs, or rejecting the signing process entirely. Validate TCPDF’s OpenSSL setup beforehand.
- Can I customize the signature pad’s appearance (e.g., colors, buttons)?
- Yes, the Blade component accepts props like `pad-classes` and `button-classes` for Tailwind/vanilla CSS styling. You can also override the default JS behavior by extending the published assets or using Alpine.js/Livewire to wrap the component.
- Do I need to write custom JavaScript to handle the signature pad?
- No, the package includes a self-contained Blade component with minimal dependencies. It handles signature capture, validation, and submission out of the box. For advanced use cases, you can extend the published JS or integrate with frontend frameworks like Alpine.js.
- Are there alternatives to this package for Laravel e-signatures?
- Alternatives include `spatie/laravel-signature-pad` (simpler, no PDFs) or commercial solutions like DocuSign’s API. This package stands out for its Eloquent integration, certified PDF support, and multi-signature capabilities. Choose based on whether you need TCPDF’s compliance features or prefer lightweight solutions.