MoonShine MoonShine
EN
← All plugins

Input extension - display the number of characters

Made by the authors of MoonShine

Character counter extension for MoonShine Laravel admin panel's input fields. This lightweight package adds a real-time character count display to text inputs, with optional minimum and maximum length validation and visual warnings. Perfect for content management where character limits are important.

Rating
Downloads
77
Version
2.0.0
Last updated
19.10.2024
MoonShine version
v2, v3
Github stars
8
Danil Shutsky
Author
Danil Shutsky

Input extension - display the number of characters

Input extension - display the number of characters for MoonShine

Installation

composer require lee-to/moonshine-input-extension-char-count
composer require lee-to/moonshine-input-extension-char-count
use Leeto\InputExtensionCharCount\InputExtensions\CharCount;
 
//
Text::make('Field')
->extension(new CharCount()),
// or
Text::make('Field')
->extension(new CharCount(250)),
// or
Text::make('Field')
->extension(new CharCount(45,5)),
use Leeto\InputExtensionCharCount\InputExtensions\CharCount;
 
//
Text::make('Field')
->extension(new CharCount()),
// or
Text::make('Field')
->extension(new CharCount(250)),
// or
Text::make('Field')
->extension(new CharCount(45,5)),

Parameters: max - integer. The value can be empty. The maximum number of characters allowed. min - integer. The value can be empty. The minimum allowed number of characters.

How does it look in the Admin Panel ?

default parameters parameters warning

If the number of characters entered in the field is less than the min parameter or less than max*20%, then the maximum allowed number of characters will be highlighted in color.