schmeits / filament-character-counter
This is a Filament character counter TextField and Textarea form field for Filament v3.2
Fund package maintenance!
schmeits
Installs: 16 306
Dependents: 2
Suggesters: 0
Security: 0
Stars: 20
Watchers: 1
Forks: 5
Open Issues: 0
Language:Blade
Requires
- php: ^8.1
- filament/filament: ^3.2
- filament/forms: ^3.2
- spatie/laravel-package-tools: ^1.16.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.10
- nunomaduro/larastan: ^2.9
- orchestra/testbench: ^v8.22
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.36
README
This is a Filament character counter TextField, Textarea and RichEditor form field for Filament v3.2
Installation
You can install the package via composer:
composer require schmeits/filament-character-counter
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
- Tally Schmeits
- Inspired on the package by Wiebe Nieuwenhuis
- All Contributors
License
The MIT License (MIT). Please see License File for more information.