Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Character Counter Laravel Package

schmeits/filament-character-counter

View on GitHub
Deep Wiki
Context7

Filament Character Counter

Latest Version on Packagist GitHub Tests Action Status Total Downloads

This is a Filament character counter TextField, Textarea and RichEditor form field for Filament v4 and v5.

If you want to use this package with Filament v3.2 see version 1.x.

example-screenshot.png

Installation

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

You can install the package via composer:

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

Note

  • For Filament v4 or v5, use version ^5.0
  • For Filament v3.2, use version ^1.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),

You can also conditionally show or hide the coutner on a per-field basis:

// Hide the counter on this field
TextInput::make('slug')
    ->showCharacterCounter(false)
    ->characterLimit(100),

// Conditionally display via Closure
Textarea::make('bio')
    ->showCharacterCounter(fn (Get $get) => $get('is_pulic'))
    ->characterLimit(255),

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium