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()),
1 replies