- What is martin-ro/filament-charcount-field used for?
- It is a Filament form field package that adds a live character counter to text inputs and textareas, helping users track remaining characters against a configured limit. It is intended as a Filament UI enhancement, not a general Laravel validation or text-management package. Use it only in applications already built on Filament.
- How do I install martin-ro/filament-charcount-field in Laravel?
- Install it with Composer using composer require martin-ro/filament-charcount-field, then follow the README for any required service provider, plugin, or asset registration. Replacing existing Filament TextInput or Textarea fields with the package field classes is likely the main integration step. Keep your existing server-side validation rules in place and pilot on one non-critical form first.
- Which Filament versions does this character count field support?
- The supplied metadata does not specify exact supported Filament majors, so check the package composer.json and README before installing. Confirm constraints against your target Filament, Laravel, PHP, and Livewire versions. Run a staging install and test field behavior on your exact Filament version before broader adoption.
- Does it support both TextInput and Textarea fields?
- The package description states it adds character counts to text inputs and textareas, but confirm exact field class support in the README. Test both field types on your Filament version before replacing them broadly. Verify helper text, min and max limits, and remaining-character display match your form requirements.
- Is the character count Unicode and emoji aware, and does it match server-side validation?
- Do not assume the client-side counter matches Laravel server-side max-length validation, especially for UTF-8, emoji, or multi-byte characters. Keep server-side validation as the source of truth and test representative Unicode content in staging. Also test counts after Livewire re-renders and when values are programmatically changed.
- Is this package a Filament plugin or a plain form field package, and how do I register it?
- It appears to be a Filament-native form field package, but the provided metadata does not confirm whether it requires plugin registration. Check the README and composer.json for service provider, plugin, and asset registration requirements. Then replace selected Filament TextInput or Textarea usages with the package field classes.
- Can I use this package without Filament in a plain Laravel app?
- No. This package is designed for Filament form fields, so it is not a substitute for general Laravel validation, text truncation, or character-counting logic outside Filament. Teams not using Filament should not adopt it. Use native Laravel validation and your own UI counter instead.
- How should I test character count behavior with Livewire and max-length validation?
- Pilot the field on one form and add acceptance tests for count accuracy, max-length enforcement, and parity with server-side validation. Test Livewire re-renders, programmatic value changes, Unicode and emoji input, and accessible count announcements. Document a fallback to native Filament fields before expanding usage.
- What are the production risks or alternatives to this Filament character count field?
- Key risks include asset loading failures, stale counts after Livewire updates, CSP blocking scripts, Filament upgrade breakage, and low adoption or maintainer abandonment. Native Filament fields with maxLength and helper text, or a small custom Alpine counter, are viable alternatives. Pin versions and limit usage until maintenance signals are confirmed.
- Does it work with Vite asset builds, CSP, dark mode, RTL, and screen readers?
- These behaviors are not confirmed by the supplied metadata, so verify them in a staging environment with your production asset build and CSP policy. Test dark mode, RTL and localized UIs, and screen-reader announcements for the counter. Treat accessibility and CSP compatibility as acceptance criteria before broader rollout.