dewakoding/filament-dewakoding
最新稳定版本:0.0.2-alpha
Composer 安装命令:
composer require dewakoding/filament-dewakoding
包简介
A collection of custom components for Laravel Filament 4
README 文档
README
Collection of custom components for Laravel Filament v4.
Installation
- Add the package to your Laravel project:
composer require dewakoding/filament-dewakoding:0.0.2-alpha
Components
DewakodingFormSignature
A signature pad component that allows users to draw signatures with mouse or touch input.
Basic Usage
use Dewakoding\FilamentDewakoding\Forms\Components\DewakodingFormSignature; DewakodingFormSignature::make('signature') ->label('Signature') ->required()
Advanced Usage with Image Storage
DewakodingFormSignature::make('signature') ->label('User Signature') ->penColor('#000000') ->width(600) ->height(250) ->clearButtonLabel('Clear Signature') ->saveAsImageColumn('signature_image') // Save as image to this column ->disk('public') // Storage disk ->directory('signatures') // Storage directory ->filename(fn($record) => 'user_' . $record?->id . '_signature_' . time() . '.png') ->required()
Available Methods
penColor(string $color)- Set pen color (default: '#000000')width(int $width)- Set canvas width (default: 500)height(int $height)- Set canvas height (default: 200)clearButtonLabel(string $label)- Set clear button text (default: 'Clear')showClearButton(bool $show)- Show/hide clear button (default: true)saveAsImageColumn(string $column)- Save signature as image to specified columndisk(string $disk)- Set storage disk (default: 'public')directory(string $directory)- Set storage directory (default: 'signatures')filename(string|Closure $filename)- Set custom filename
Using with Livewire
To enable image saving functionality, add the trait to your Filament Resource:
use Dewakoding\FilamentDewakoding\Concerns\HasSignatureImage; class UserResource extends Resource { use HasSignatureImage; // ... rest of your resource }
DewakodingFormStarRating
A star rating component that allows users to rate items with interactive stars and hover effects.
Basic Usage
use Dewakoding\FilamentDewakoding\Forms\Components\DewakodingFormStarRating; DewakodingFormStarRating::make('rating') ->label('Product Rating') ->required()
Advanced Usage
DewakodingFormStarRating::make('rating') ->label('Product Rating') ->maxStars(10) // Number of stars (default: 5) ->color('#fbbf24') // Filled star color (default: #fbbf24) ->emptyColor('#d1d5db') // Empty star color (default: #d1d5db) ->required()
Available Methods
maxStars(int $maxStars)- Set maximum number of stars (default: 5)color(string $color)- Set filled star color (default: '#fbbf24')emptyColor(string $color)- Set empty star color (default: '#d1d5db')
Requirements
- Laravel 12+
- Filament 4+
- PHP 8.2+
License
MIT License
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-12
