TextInput, set default value (from backend)
Currently I have
TextInput::make('user.name')
.
The name
field of the user
relation already have an value.
However it's not showing in the forms. So how can I make it show?10 Replies
Scope the section to 'user' relationship and then have a single field named 'name';
Please provide the code if you need more help
My code was like this
I tried your way
Neither way worked
More help please
I think, it will work in select?
don't forget to add so it will automatically list all user upon loading of the page
Yes, your way works for select.
But how about for
TextInput
?it won't work in TextInput since it is text input.
Ok.
I just need a label, showing the user name in the form.
How can that be done?
wdym?
you want to retrieve the name from user? then set it to current form?
Solution
Your code should actually do it. But you need to check if the relationships on the model is set.
Thank you