->live()
->password()
->label(__('filament-panels::pages/auth/register.form.password.label'))
->required()
->rule(Password::default())
->dehydrateStateUsing(fn ($state) => Hash::make($state))
->same('passwordConfirmation')
->revealable(filament()->arePasswordsRevealable())
->validationAttribute(__('filament-panels::pages/auth/register.form.password.validation_attribute'))
->afterStateUpdated(function ($state, Set $set) {
if (empty($state)) {
return;
}
$score = (new Zxcvbn())->passwordStrength($state)['score'];
$set('strengthScore', $score);
$this->dispatch('update-score', score: $score);
}
->live()
->password()
->label(__('filament-panels::pages/auth/register.form.password.label'))
->required()
->rule(Password::default())
->dehydrateStateUsing(fn ($state) => Hash::make($state))
->same('passwordConfirmation')
->revealable(filament()->arePasswordsRevealable())
->validationAttribute(__('filament-panels::pages/auth/register.form.password.validation_attribute'))
->afterStateUpdated(function ($state, Set $set) {
if (empty($state)) {
return;
}
$score = (new Zxcvbn())->passwordStrength($state)['score'];
$set('strengthScore', $score);
$this->dispatch('update-score', score: $score);
}