F
Filament16mo ago
Zakhaev

Can i use a key/value logic on a textinput field?

Hi folks, i have a field where i display the username. But i want to save the ID to the database. Is this possible?
TextInput::make('user_id')
->label('Gebruiker')
->disabled()
->id($user->id)
->default($user->full_name),
TextInput::make('user_id')
->label('Gebruiker')
->disabled()
->id($user->id)
->default($user->full_name),
i tried using id field in default i display the username
Solution:
i fixed this by making it a select field
Jump to solution
2 Replies
Zakhaev
ZakhaevOP16mo ago
TextInput::make('user_id')
->label('Gebruiker')
->disabled()
->default(
[
'value' => $user->full_name,
'id' => $user->id
]),
TextInput::make('user_id')
->label('Gebruiker')
->disabled()
->default(
[
'value' => $user->full_name,
'id' => $user->id
]),
i also tried this but still not working
Solution
Zakhaev
Zakhaev16mo ago
i fixed this by making it a select field
Want results from more Discord servers?
Add your server