bradwarwick / signature-pad
适用于 FilamentPHP 的签名垫
v2.0.0
2024-10-01 20:30 UTC
Requires
- php: ^8.3
- filament/forms: ^3.0
- illuminate/contracts: ^11.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- filament/filament: ^3.0
- laravel/pint: ^1.0
- nunomaduro/collision: ^8.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^9.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- roave/security-advisories: dev-latest
- spatie/laravel-ray: ^1.26
README
这是一个基于 szimek/signature_pad 的 FilamentPHP 签名垫字段。
注意:本文档针对 ^v2.0
版本,仅支持 FilamentPHP ^3.0
。如果您使用的是 Filament 2.x
,应使用 SignaturePad v1.x
。 请在此处查看文档
安装
您可以通过 composer 安装此包
composer require coolsam/signature-pad
接下来,发布 filament 的资源,以确保插件资源被发布到公共目录。
php artisan filament:assets
您还可以使用以下命令发布包的翻译
php artisan vendor:publish --tag="signature-pad-translations"
您可以使用以下命令发布配置文件
php artisan vendor:publish --tag="signature-pad-config"
用法
在您的 Filament 表单中使用方法如下
use Coolsam\SignaturePad\Forms\Components\Fields\SignaturePad; SignaturePad::make('my_signature'), // Other methods SignaturePad::make('signature') ->backgroundColor('white') // Set the background color in case you want to download to jpeg ->penColor('blue') // Set the pen color ->strokeMinDistance(2.0) // set the minimum stroke distance (the default works fine) ->strokeMaxWidth(2.5) // set the max width of the pen stroke ->strokeMinWidth(1.0) // set the minimum width of the pen stroke ->strokeDotSize(2.0) // set the stroke dot size. ->hideDownloadButtons() // In case you don't want to show the download buttons on the pad, you can hide them by setting this option.
就这样!享受创作美丽的签名吧。
测试
composer test
更新日志
请查看 更新日志 了解最近的变化。
贡献
请查看 贡献指南 了解详情。
安全漏洞
请查看 我们的安全策略 了解如何报告安全漏洞。
致谢
许可证
MIT 许可证(MIT)。请查看 许可证文件 了解更多信息。