F
Filament5mo ago
core

regex format lowercase validation on Spatie Tags Input not working on input

I want to accept only lowercase entries as this package saves in a json column the entries are not unique so I can get multiple entries for the same tag
use Filament\Forms\Components\SpatieTagsInput;

Forms\Components\Section::make('Recipe Tags')
->schema([
SpatieTagsInput::make('tags')
->regex('/^[a-z0-9_\-]+$/')
->validationMessages([
'regex' => 'The :attribute format should be lowercase, numbers, underscores, and hyphens only.',
])
->type('recipe'),
]),
use Filament\Forms\Components\SpatieTagsInput;

Forms\Components\Section::make('Recipe Tags')
->schema([
SpatieTagsInput::make('tags')
->regex('/^[a-z0-9_\-]+$/')
->validationMessages([
'regex' => 'The :attribute format should be lowercase, numbers, underscores, and hyphens only.',
])
->type('recipe'),
]),
inside the RecipeResource , i get the message on lowercase inputs because it's json, so I need to take care of it after the saved method
0 Replies
No replies yetBe the first to reply to this messageJoin