euginepj / laravel-password-strength
Comprehensive password strength analyzer, scoring engine, and validation rule package for Laravel.
Package info
github.com/euginepj/laravel-password-strength
pkg:composer/euginepj/laravel-password-strength
v1.0.0
2026-10-14 07:32 UTC
Requires
- php: ^8.2
- illuminate/contracts: ^10.0|^11.0|^12.0
- illuminate/support: ^10.0|^11.0|^12.0
- illuminate/translation: ^10.0|^11.0|^12.0
- illuminate/validation: ^10.0|^11.0|^12.0
Requires (Dev)
- orchestra/testbench: ^8.0|^9.0|^10.0
- phpunit/phpunit: ^10.0|^11.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
A comprehensive password strength analyzer, scoring engine, and validation rule package for Laravel applications.
โจ Features
- Entropy & Complexity Evaluator: Analyzes character sets, length, repeated characters, and sequential keyboard patterns.
- Common Password Detection: Rejects commonly breached and guessed passwords (
123456,password,qwerty, etc.). - Customizable Validation Rule: Fluent and configurable validation rule with custom thresholds.
- Score & Feedback Output: Returns percentage (0โ100%), score (0โ4), security level (
weak,medium,strong,very_strong), and user-facing suggestions.
๐ฆ Installation
Install via Composer:
composer require euginepj/laravel-password-strength:^1.0
Publish configuration (optional):
php artisan vendor:publish --tag=password-strength-config
Publish translation messages (optional):
php artisan vendor:publish --tag=password-strength-lang
๐ Usage
1. In Form Requests / Controllers
use Euginepj\PasswordStrength\Rules\PasswordStrengthRule; $request->validate([ 'password' => ['required', new PasswordStrengthRule()], ]); // Or with fluent configuration: $request->validate([ 'password' => [ 'required', (new PasswordStrengthRule()) ->min(10) ->requireSymbols() ->minScore(3), ], ]);
2. Evaluator via Facade
use Euginepj\PasswordStrength\Facades\PasswordStrength; $result = PasswordStrength::evaluate('MySecret#2026'); $result->score; // 4 (0 to 4) $result->percentage; // 100 (%) $result->level; // "very_strong" $result->passed; // true $result->feedback; // []
3. Facade Rule Shortcut
use Euginepj\PasswordStrength\Facades\PasswordStrength; $request->validate([ 'password' => [ 'required', PasswordStrength::rule()->min(10)->minScore(3), ], ]);
๐งช Testing
composer test
๐ License
The MIT License (MIT). Please see License File for more information.