Hiding multi-select options but only on edit - using relationships

                Fieldset::make('Roles')
                    ->schema([
                        Forms\Components\Select::make('roles')
                            ->label('')
                            ->multiple()
                            ->relationship('roles', 'name')
                            ->preload()
                            ->required(),
                    ])
                    ->columns(1),


I have the above, however. WHen it comes to editing, I want to hide the "admin" role if the record user is the same as the authenticated user (This is to prevent an admin from removing the admin role from themselves) but still allow them to give/take other roles from the system
Was this page helpful?