filament-char-counter
filament-char-counter copied to clipboard
Why don't you submit it as part of the Filament?
I see that this is a nice feature that could be included natively in the Filament.
You can create a Concerns with your code to make it easier to be reused, for example:
namespace Filament\Tables\Columns\Concerns;
use Closure;
trait HasCharacterLimit
{
protected $characterLimit = 0;
public function characterLimit(int $value): self
{
$this->characterLimit = $value;
return $this;
}
public function getCharacterLimit(): int
{
if ($this->maxLength) {
return $this->maxLength;
}
return $this->characterLimit;
}
}