olssonm/l5-zxcvbn
Larablocks Analysis
olssonm/l5-zxcvbn works with Laravel 12 and 13 (latest release v6.0, Mar 19, 2026).
Laravel 5 to 11 in earlier releases.
Recommendation checks
Solid choiceSolid choice: maintained and up to date, meets 3 of 4 checks; below the bar for Recommended on use.
- Works with Laravel 13, the current version
- Released in the last 12 months (Mar 19, 2026)
- 11,303 downloads a month (at least 10,000)
- 29 GitHub stars (needs 100)
State
Maintained- Last stable release: Mar 19, 2026.
- 1 release in the last 12 months.
- First released: Oct 16, 2015.
- Monthly downloads: 11,303, up 56% from six months ago.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 3, 2026.
| Install | |
|---|---|
composer require olssonm/l5-zxcvbn |
|
| Latest Version: | v6.0 |
| PHP: | ^8.2 |
| Laravel: | 12 · 13 |
| Older releases: | 5 – 11 |
| License: | MIT |
| Last Updated: | Mar 19, 2026 |
| Links: | GitHub · Packagist |
Zxcvbn for Laravel

A simple implementation of zxcvbn for Laravel. This package allows you to access "zxcvbn-related" data on a passphrase in the application and also to use zxcvbn as a standard validator.
Uses Zxcvbn-PHP by @bjeavons, which in turn is inspired by zxcvbn by @dropbox.
Install
Via Composer
$ composer require olssonm/l5-zxcvbn
If you wish to have the ability to use Zxcvbn via dependency injection, or just have a quick way to access the class – add an alias to the facades:
'aliases' => [
'Zxcvbn' => Olssonm\Zxcvbn\Facades\Zxcvbn::class
]
Usage
If you've added Olssonm\Zxcvbn as an alias, your can access Zxcvbn easily from anywhere in your application:
"In app"
use Zxcvbn;
class MyClass extends MyOtherClass
{
public function myFunction()
{
$zxcvbn = Zxcvbn::passwordStrength('password');
dd($zxcvbn);
// array:9 [
// "password" => "password"
// "guesses" => 3.0
// "guesses_log10" => 0.47712125471966
// "sequence" => [],
// "crack_times_seconds" => array:4 [
// "online_throttling_100_per_hour" => 108.0
// "online_no_throttling_10_per_second" => 0.3
// "offline_slow_hashing_1e4_per_second" => 0.0003
// "offline_fast_hashing_1e10_per_second" => 3.0E-10
// ]
// "crack_times_display" => array:4 [
// "online_throttling_100_per_hour" => "2 minutes"
// "online_no_throttling_10_per_second" => "less than a second"
// "offline_slow_hashing_1e4_per_second" => "less than a second"
// "offline_fast_hashing_1e10_per_second" => "less than a second"
// ]
// "score" => 0
// "feedback" => array:2 [
// "warning" => "This is a top-10 common password"
// "suggestions" => array:1 [
// 0 => "Add another word or two. Uncommon words are better."
// ]
// ]
// "calc_time" => 0.020488977432251
// ]
}
}
Play around with different passwords and phrases, the results may surprise you. Check out Zxcvbn-PHP for more uses and examples.
As a validator
The package makes two types of validations available for your application. zxcvbn and zxcvbn_dictionary.
zxcvbn
With this rule you set the lowest score that the phrase need to score wuth Zxcvbn to pass.
Syntax
'input' => 'zxcvbn:min_value'
Examples
$request->validate([
'password' => 'required|zxcvbn:3'
]);
You may also initialize the rule as an object:
use Olssonm\Zxcvbn\Rules\Zxcvbn;
function rules()
{
return [
'password' => ['required', new Zxcvbn($minScore = 3)]
];
}
In this example the password should at least have a "score" of three (3) to pass the validation. Of course, you should probably use the zxcvbn-library on the front-end too to allow the user to know this before posting the form.
zxcvbn_dictionary
This is a bit more interesting. zxcvbn_dictionary allows you to input both the users username and/or email together with their password (you need suply one piece of user input). The validator checks that the password doesn't exist in the username, or that they are too similar.
Syntax
'input' => 'zxcvbn_dictionary:input1,input2'
Examples
$request->validate([
'password' => sprintf('required|zxcvbn_dictionary:%s,%s', $request->username, $request->email)
]);
use Olssonm\Zxcvbn\Rules\ZxcvbnDictionary;
function rules()
{
return [
'password' => ['required', new ZxcvbnDictionary($this->username)]
];
}
Testing
$ composer test
or
$ phpunit
License
The MIT License (MIT). Please see the License File for more information.
© 2022 Marcus Olsson.
Alternatives to olssonm/l5-zxcvbn
Protect your users from entering dumb and common passwords
Service provider to use the zxcvbn project by @dropbox in Laravel 5.4 and above
A simple, standalone Laravel CAPTCHA package with multiple styles and difficulty...
A laravel package that protect users from entering non-existing/spam email addre...
A comprehensive Laravel package for integrating Google reCAPTCHA v2 and v3 with...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v6.0 | ^8.2 | ^12.0| | MIT | |
| v5.3 | ^7.4| | ^7.0| | MIT | |
| v5.2 | ^7.4| | ^7.0| | MIT | |
| v5.1 | ^7.4| | ^7.0| | MIT | |
| v5.0 | ^7.4| | ^7.0| | MIT | |
| v4.5 | ^7.3| | ^7.0| | MIT | |
| v4.4 | ^7.3| | ^6.0| | MIT | |
| v4.3 | ^7.1 | >=5.8| | MIT | |
| v4.2 | ^7.1 | >=5.8| | MIT | |
| v4.1 | ^7.1 | >=5.8 || | MIT | |
| v4.0 | >=7.1.3 | ^5.8 | MIT | |
| v3.3 | >=7.1.3 | ^5.8 | MIT | |
| v3.2 | >=5.6.0| | >=5.3.0 | MIT | |
| v3.1 | >=5.6.0| | ~5.3| | MIT | |
| v3.0 | >=5.6.0| | ~5.3.28| | MIT | |
| v2.2 | >=5.6.0 | ~5.3.28| | MIT | |
| v2.1 | >=5.3.0 | ~5.3 | MIT | |
| v2.0 | >=5.3.0 | ~5.3 | MIT | |
| v1.0 | >=5.3.0 | ~5.1 | MIT |