© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•12mo ago•
8 replies
bottbott

validationMessages within createOptionsFrom not working as expected

Hi All,

->createOptionForm([
    TextInput::make('name')
        ->label('Job Title')
        ->maxLength(255)
        ->required()
        ->validationMessages([
            'required' => 'A job title is required.',
            'max' => 'Job title cannot exceed 255 characters.'
        ]),
    TextInput::make('acronym')
        ->label('Acronym')
        ->nullable()
])
->createOptionForm([
    TextInput::make('name')
        ->label('Job Title')
        ->maxLength(255)
        ->required()
        ->validationMessages([
            'required' => 'A job title is required.',
            'max' => 'Job title cannot exceed 255 characters.'
        ]),
    TextInput::make('acronym')
        ->label('Acronym')
        ->nullable()
])

this produces the screenshot with orange ! icon, I'd expect it to show with red text like the other screenshot!? Any ideas?

Cheers, Bot
image.png
image.png
Solution
@awcodes, We have managed to work this one out:

TextInput::make('name')
  ->label('Job Title')
  ->rules(Rule::requiredIf(true)),
TextInput::make('name')
  ->label('Job Title')
  ->rules(Rule::requiredIf(true)),
Jump to solution
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

validationMessages not working for regex
FilamentFFilament / ❓┊help
2y ago
`validationMessages` not working via `validateOnly`
FilamentFFilament / ❓┊help
13mo ago
Notifications Markup not working as expected?
FilamentFFilament / ❓┊help
2y ago
TextColumn action not working as expected
FilamentFFilament / ❓┊help
2y ago