© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago
speed

TextInput default value at ViewResource page

1) I have my resource view page, where we have a custom form that shows us different sets of data fields based on the type of "document" (resource type).
2) I'm replacing the default form with my own and placing form elements I need based on my logic.

The question is how to fill this TextEdit field with the needed data. I checked if the data I need is available (it is); it just looks like the default statement doesn't work. Tried to fill it with static text - and it doesn't work too.

Sample of code:
->default(fn ($record) => optional($record->user)->name ?? 'N/A'),

Sample of code with static text:
TextInput::make('simpleTest')
->label('Simple Test')
->default(fn() => $this->id()),
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

TextInput default value on edit page
FilamentFFilament / ❓┊help
2y ago
TextInput Default value
FilamentFFilament / ❓┊help
3y ago
TextInput, set default value (from backend)
FilamentFFilament / ❓┊help
2y ago
TextInput default = object?
FilamentFFilament / ❓┊help
3y ago