Select automatically select the first one
Hello,
Given this example:
In case there is only one user. Is it possible to automatically set the value of the select to that user?
Thanks .
2 Replies
You could use ->default() to test and set it.
Honestly though, if there’s only one user I would just hide it and set the value during the record creation to the authenticated user.
True. I will try default. I have more use cases for this then just the authenticated user. But if default accepts a closure then I will be able to solve it.