© 2026 Hedgehog Software, LLC
public int $strengthScore = 0;
$set
TextInput::make('password') ->live() // other rules ->hintAction( Action::make('generate') ->label('Generate') ->action(function (Set $set, Get $get) { $password = Str::password(12); $set('password', $password); $set('passwordConfirmation', $password); $set('strengthScore', (new Zxcvbn())->passwordStrength($password)['score']); }), );
strengthScore
$wire.$entangle
x-data
<div x-data="{ strengthScore: $wire.$entangle('strengthScore', live = true) }"> <progress value="{{ $this->strengthScore }}" max="4" class="w-full"></progress> </div>
$score = (new Zxcvbn())->passwordStrength($password)['score']; $set('strengthScore', $score); $this->dispatch('update-score', score: $score);