Download the PHP package olssonm/l5-zxcvbn without Composer
On this page you can find all versions of the php package olssonm/l5-zxcvbn. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download olssonm/l5-zxcvbn
More information about olssonm/l5-zxcvbn
Files in olssonm/l5-zxcvbn
Package l5-zxcvbn
Short Description Implementation of the zxcvbn project by @dropbox for Laravel. Uses zxcvbn-php by @bjeavons.
License MIT
Homepage https://github.com/olssonm/laravel-zxcvbn
Informations about the package l5-zxcvbn
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
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:
Usage
If you've added Olssonm\Zxcvbn
as an alias, your can access Zxcvbn easily from anywhere in your application:
"In app"
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
Examples
You may also initialize the rule as an object:
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
Examples
Testing
or
License
The MIT License (MIT). Please see the License File for more information.
© 2022 Marcus Olsson.
All versions of l5-zxcvbn with dependencies
illuminate/support Version ^7.0|^8.0|^9.0|^10.0|^11.0
bjeavons/zxcvbn-php Version ^1.2