TextEntry::make()->placeholder() question...

Hi all, I'm finding myself putting ->placeholder('Blank') on every single TextEntry in my Infolists. Question: is there a method to globally apply this behavior? Essentially, anytime a field returns null or an empty string, I'd like to display "Blank" to the user... Thanks!
2 Replies
cheesegrits
cheesegrits14mo ago
In a service provider (like the boot() method of your AppServiceProvider, try this ...
TextEntry::configureUsing(function (TextEntry $textEntry): void {
$textEntry->placeholder('Blank');
});
TextEntry::configureUsing(function (TextEntry $textEntry): void {
$textEntry->placeholder('Blank');
});
You can do this with any Filament component. Search for configureUsing in the docs. For example ... https://filamentphp.com/docs/3.x/infolists/layout/getting-started#global-settings
noahlocke
noahlockeOP14mo ago
Fantastic—thanks much @Hugh Messenger !
Want results from more Discord servers?
Add your server