SebastiaanKloos / filament-code-editor

Code editor for Filament
MIT License
30 stars 18 forks source link

Can't set default() on textarea #4

Open marianvlad opened 2 years ago

marianvlad commented 2 years ago

I have a textarea input and I want to fill with settings data from database but I can't use default method

Forms\Components\Textarea::make('api_key')->required()->default('api key .....'),

KielD-01 commented 1 year ago

@marianvlad this one is non-related. But let me help You out on this:

Textarea::make('api_key')
    ->placeholder('API Key')
    ->formatStateUsing(fn ($set, $get) => $set('api_key', $get('api_key') ?? ''))

@SebastiaanKloos this one should be closed