savannabits / filament-signature-pad
FilamentPHP 签名垫
v2.0.0-beta.1
2023-08-12 09:27 UTC
Requires
- php: ^8.1
- filament/forms: ^3.0
- illuminate/contracts: ^10.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- filament/filament: ^3.0
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-09-09 07:28:03 UTC
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
变更日志
请参阅 CHANGELOG 了解最近更改的详细信息。
贡献
请参阅 CONTRIBUTING 了解详细信息。
安全漏洞
请查看 我们的安全策略 了解如何报告安全漏洞。
致谢
许可
MIT 许可证(MIT)。请参阅 许可文件 了解更多信息。