© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•11mo ago•
6 replies
rominronin

Validation messages are not htmlable, but they output htmlable label values by default

When I create a TextInput field, I can make the label htmlable:
TextInput::make('column')
  ->label(fn() => new HtmlString('<span>Some text</span>'))
  ->required()
TextInput::make('column')
  ->label(fn() => new HtmlString('<span>Some text</span>'))
  ->required()

This is fine, however validation messages are currently not htmlable, and this leads to an undesired bug in the output of validation messages, see image.

Is there a way to solve this?

Right now it seems the only solution to this it to completely customise the validation messages, but this is unfeasible. Ideally, the validation message might either take the rendered label html, or would be htmlable too.

Or is there some other way around this?
image.png
Solution
I just discovered
->validationAttribute()
->validationAttribute()
, which solves this by allowing you to independently define the attribute used in validation messages!!!
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

Htmlable label - illegal offset type
FilamentFFilament / ❓┊help
2y ago
Validation messages
FilamentFFilament / ❓┊help
3y ago
Default Label-Translations
FilamentFFilament / ❓┊help
5mo ago
Htmlable Filter
FilamentFFilament / ❓┊help
2y ago