Mandatory password on the user change screen?

I registered the user to access the admin Panel. When trying to change the data, the user is forced to enter the password when I only want to change the user name. How to solve this problem?
1 Reply
awcodes
awcodes12mo ago
Show it on Create, hide it on edit, but use a toggle to show it on edit if it needs to be reset.
Forms\Components\Toggle::make('reset_password')
->reactive()
->default(false)
->hiddenOn('create')
->dehydrated(false),
Forms\Components\TextInput::make('password')
->visible(fn (Forms\Get $get, $operation) => $operation === 'create' || $get('reset_password'))
->required()
->dehydrateStateUsing(fn ($state) => Hash::make($state))
Forms\Components\Toggle::make('reset_password')
->reactive()
->default(false)
->hiddenOn('create')
->dehydrated(false),
Forms\Components\TextInput::make('password')
->visible(fn (Forms\Get $get, $operation) => $operation === 'create' || $get('reset_password'))
->required()
->dehydrateStateUsing(fn ($state) => Hash::make($state))
Want results from more Discord servers?
Add your server