Heyya,
I am working on Select
FormsComponentsSelect::make('roles')->options(function (){
$roles = Role::pluck('name');
$filtered_roles = $roles->filter(fn($role)=>$role!='super_admin');
return $filtered_roles;
})->searchable()->preload()->multiple()
Works great. However on the edit page it doesnt show already defined roles for specific user. Each time it show select one of the roles
I expect it would show me currently selected roles on edit
2
Answers
Okay here is a solution i manage to find myself.
I hope it will be useful for you guys who suffer same situation.
Use
fill()
inmount()