schmeits
This is a Filament character counter TextField and Textarea form field for Filament v3.2
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 (beta) see the installation instructions below.
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 (beta), you can install the package via composer:
composer require schmeits/filament-character-counter:"^4.0@beta"
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',
];
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),
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.