I need to show a selected role of User in the Select Fields is there any method in which I can pass the value and it would be selected by default with the show Labels.
Asked
Active
Viewed 3,389 times
1 Answers
12
The problem is completely solved, the solution is:
Select::make('My type', 'type')
->options(\App\Models\Cost::TYPE)
->sortable()
->resolveUsing(function () {
return $this->type ?? 'expense';
})
->displayUsingLabels()
->rules('required'),

Oleksandr Roskovynskyi
- 434
- 4
- 9