bradwarwick/signature-pad

适用于 FilamentPHP 的签名垫

v2.0.0 2024-10-01 20:30 UTC

This package is auto-updated.

Last update: 2024-10-02 21:44:52 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

这是一个基于 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)。请查看 许可证文件 了解更多信息。