© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
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
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

filament spatie tags disable new tags on input
FilamentFFilament / ❓┊help
11mo ago
Filament Tags Input vs. Spatie Tags
FilamentFFilament / ❓┊help
4mo ago
Text Input Column Validation Not Working
FilamentFFilament / ❓┊help
2y ago
Spatie Tags plugin
FilamentFFilament / ❓┊help
2y ago