schmeits/filament-character-counter 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

schmeits/filament-character-counter

最新稳定版本:4.0.0

Composer 安装命令:

composer require schmeits/filament-character-counter

包简介

This is a Filament character counter TextField and Textarea form field for Filament v3.2

README 文档

README

Latest Version on Packagist GitHub Tests Action Status Total Downloads

This is a Filament character counter TextField, Textarea and RichEditor form field for Filament v3.2 and above.

If you want to use this package with Filament v4 see the installation instructions below.

example-screenshot.png

Installation

Plugin Version Filament Version PHP Version
1.x 3.2 > 8.1
4.x 4.x > 8.2

You can install the package via composer:

composer require schmeits/filament-character-counter

Warning If you are using Filament 4, you can install the package via composer:

 composer require schmeits/filament-character-counter:"^4.0"

You can publish the translations file with:

php artisan vendor:publish --tag="filament-character-counter-translations"

This is the contents of the published translation file:

return [
    'character_seperator' => ' / ',
    'character_label' => 'characters',
];

Usage

use Schmeits\FilamentCharacterCounter\Forms\Components\TextInput;
use Schmeits\FilamentCharacterCounter\Forms\Components\Textarea;

TextInput::make('title')
    ->characterLimit(50),

Textarea::make('description')
    ->characterLimit(155),

RichEditor::make('content')
    ->characterLimit(155),

maxLength can also be used to limit the maximum number of characters, there is no need to specify the characterLimit as well.

TextInput::make('title')
    ->maxLength(50),

As an additional option, you can place the counter within your component using:

TextInput::make('title')
    ->showInsideControl(true)
    ->characterLimit(50),

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 151.54k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 33
  • 点击次数: 1
  • 依赖项目数: 6
  • 推荐数: 0

GitHub 信息

  • Stars: 33
  • Watchers: 1
  • Forks: 14
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-24