filament-char-counter icon indicating copy to clipboard operation
filament-char-counter copied to clipboard

Why don't you submit it as part of the Filament?

Open moskoweb opened this issue 2 years ago • 1 comments

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;
    }
}

moskoweb avatar Feb 17 '23 15:02 moskoweb