Trying to set up this custom field and want to add a prefix $ icon. I can't seem to get a prefix to work on this field and wondering what I'm doing wrong.
use Filament\Forms\Components\Field;use Filament\Forms\Components\Concerns\HasAffixes;class MathInput extends Field{ use HasAffixes; protected string $view = 'forms.components.math-input'; protected function setUp(): void { parent::setUp(); $this->live(onBlur: true) ->afterStateUpdated(function (?string $state, ?string $old) { if ($state != null) { $updatedState = $this->performMathOperation($state); $this->state($updatedState); } }); } public function getPrefixIcon(): ?string { return 'heroicon-o-currency-dollar'; }
use Filament\Forms\Components\Field;use Filament\Forms\Components\Concerns\HasAffixes;class MathInput extends Field{ use HasAffixes; protected string $view = 'forms.components.math-input'; protected function setUp(): void { parent::setUp(); $this->live(onBlur: true) ->afterStateUpdated(function (?string $state, ?string $old) { if ($state != null) { $updatedState = $this->performMathOperation($state); $this->state($updatedState); } }); } public function getPrefixIcon(): ?string { return 'heroicon-o-currency-dollar'; }
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament