Delete option inside select field
Select::make('roles')
// ->createOptionForm(function(Form $form){
// return RoleResource::form($form);
// })
->editOptionForm(function(Form $form){
return RoleResource::form($form);
})
// ->manageOptionActions(function(){
// return [
// DeleteAction::make('delete')
// ];
// })
// ->getEditOptionActionForm()
->label(__('Role'))
->relationship('roles', 'name')
// ->multiple()
->preload()
->searchable()
->options(function () {
return Role::all()->pluck('name', 'id')->map(function ($role) {
return ucwords(str_replace('_', ' ', $role));
})->toArray();
}),
Select::make('roles')
// ->createOptionForm(function(Form $form){
// return RoleResource::form($form);
// })
->editOptionForm(function(Form $form){
return RoleResource::form($form);
})
// ->manageOptionActions(function(){
// return [
// DeleteAction::make('delete')
// ];
// })
// ->getEditOptionActionForm()
->label(__('Role'))
->relationship('roles', 'name')
// ->multiple()
->preload()
->searchable()
->options(function () {
return Role::all()->pluck('name', 'id')->map(function ($role) {
return ucwords(str_replace('_', ' ', $role));
})->toArray();
}),
0 Replies