- How do I install and set up creagia/laravel-sign-pad in a Laravel 12 project?
- Run `composer require creagia/laravel-sign-pad`, then execute `php artisan sign-pad:install` to publish config, migrations, and assets. Run migrations with `php artisan migrate`, and publish JS assets with `php artisan vendor:publish --tag=sign-pad-assets`. The assets will be placed in `public/vendor/sign-pad/`.
- Which Laravel and PHP versions does this package support?
- The package supports Laravel 11–13 and PHP 8.2–8.5. Ensure your project meets these requirements before installation. Check the [GitHub repository](https://github.com/creagia/laravel-sign-pad) for updates on version compatibility.
- How do I enable signature capture for an Eloquent model?
- Add the `RequiresSignature` trait and implement the `CanBeSigned` contract to your model. For PDF generation, also implement `ShouldGenerateSignatureDocument` and define a template using `getSignatureDocumentTemplate()`. The package handles the rest, including storing signatures in the database.
- Can I customize where signatures and PDFs are stored?
- Yes, configure storage disks in `config/sign-pad.php`. The package defaults to the `public` disk but allows customization for local, S3, or other supported disks. Ensure the disk is properly configured in Laravel’s `filesystems.php`.
- Does this package support certified PDFs, and how do I configure them?
- Yes, the package uses TCPDF to generate certified PDFs. Implement `ShouldGenerateSignatureDocument` on your model and define a template. Configure TCPDF’s certificate settings in `config/sign-pad.php`—use a trusted CA certificate in production for legally compliant documents.
- How do I handle redirects after a user signs a document?
- Configure the `redirect_route_name` in `config/sign-pad.php`. The redirect route will receive the signature model’s UUID as a parameter. Ensure the route is defined in your `routes/web.php` or `routes/api.php` to handle the redirect logic.
- What happens if I need to upgrade from an older version of this package?
- Major version upgrades may introduce breaking changes, such as disk configuration updates. Review the [changelog](https://github.com/creagia/laravel-sign-pad/blob/main/CHANGELOG.md) and test thoroughly in a staging environment. Backup your database and assets before upgrading.
- Is there a way to validate or verify signatures after they’re captured?
- The package stores signatures as images and metadata but does not include built-in validation (e.g., biometric checks). For high-assurance use cases, implement custom logic using the stored signature data or integrate third-party validation services.
- Can I use this package in a multi-tenant Laravel application?
- Shared storage paths may cause conflicts in multi-tenant apps. Use tenant-specific disks or prefixes in the `config/sign-pad.php` to isolate signatures and documents. Alternatively, override the default storage logic in your model’s `getSignatureDisk()` method.
- How do I handle large-scale PDF generation without performance issues?
- TCPDF can be resource-intensive for high-volume PDF generation. Offload the process by using Laravel queues (e.g., `signed:document` event) and a worker like Laravel Horizon. Monitor memory/CPU usage and consider optimizing TCPDF’s settings for large documents.