From 788056d55d7d1b7e3b6ebfa5af0726142588a1ad Mon Sep 17 00:00:00 2001 From: Lance Pioch Date: Sun, 21 Apr 2024 16:18:13 -0400 Subject: [PATCH] Small updates --- app/Filament/Resources/EggResource.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/Filament/Resources/EggResource.php b/app/Filament/Resources/EggResource.php index 7c5ce79a1..13c234d04 100644 --- a/app/Filament/Resources/EggResource.php +++ b/app/Filament/Resources/EggResource.php @@ -103,9 +103,18 @@ class EggResource extends Resource return $data; }) ->schema([ - Forms\Components\TextInput::make('name')->live()->maxLength(191)->columnSpanFull()->required(), + Forms\Components\TextInput::make('name') + ->live() + ->debounce(1000) + ->maxLength(191) + ->columnSpanFull() + ->afterStateUpdated(fn (Forms\Set $set, $state) => $set('env_variable', str($state)->trim()->snake()->upper())) + ->required(), Forms\Components\Textarea::make('description')->columnSpanFull(), - Forms\Components\TextInput::make('env_variable')->maxLength(191)->required(), + Forms\Components\TextInput::make('env_variable') + ->label('Environment Variable') + ->maxLength(191) + ->required(), Forms\Components\TextInput::make('default_value')->maxLength(191), Forms\Components\Textarea::make('rules')->rows(3)->columnSpanFull(), ]),