Search by

euginepj / laravel-password-strength

euginepj

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

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-10-14 07:32 UTC

This package is auto-updated.

Last update: 2026-10-14 09:02:25 UTC


README

Latest Version on Packagist Run Tests Total Downloads License

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.