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();
              }),

is there a way i can add a delete option inside the select filed or remove that
i got the edit action working but wont find any solution for remove
Screenshot_from_2024-03-14_10-55-36.png
Was this page helpful?