Update for PHP 8 (#17)
* Update for PHP 8 * Switch to bjeavons/zxcvbn-php-library
This commit is contained in:
parent
4fff615d5f
commit
7032f90820
10
.travis.yml
10
.travis.yml
|
|
@ -11,17 +11,13 @@ script:
|
|||
|
||||
matrix:
|
||||
include:
|
||||
- php: 7.1
|
||||
env: ILLUMINATE_VERSION=5.8.*
|
||||
- php: 7.2
|
||||
- php: 7.3
|
||||
env: ILLUMINATE_VERSION=^6.0
|
||||
- php: 7.2
|
||||
env: ILLUMINATE_VERSION=^7.0
|
||||
- php: 7.3
|
||||
env: ILLUMINATE_VERSION=^7.0
|
||||
- php: 7.4
|
||||
env: ILLUMINATE_VERSION=^7.0
|
||||
- php: 7.3
|
||||
env: ILLUMINATE_VERSION=^8.0
|
||||
- php: 7.4
|
||||
env: ILLUMINATE_VERSION=^8.0
|
||||
- php: 8.0
|
||||
env: ILLUMINATE_VERSION=^8.0
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 Marcus Olsson <contact@marcusolsson.me>
|
||||
Copyright (c) 2020 Marcus Olsson <contact@marcusolsson.me>
|
||||
|
||||
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
> of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
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](https://github.com/mkopinsky/zxcvbn-php) by [@mkopinsky](https://github.com/mkopinsky) (originally by [@bjeavons](https://github.com/bjeavons)), which in turn is inspired by [zxcvbn](https://github.com/dropbox/zxcvbn) by [@dropbox](https://github.com/dropbox).
|
||||
Uses [Zxcvbn-PHP](https://github.com/bjeavons/zxcvbn-php) by [@bjeavons](https://github.com/bjeavons) and [@mkopinsky](https://github.com/mkopinsky), which in turn is inspired by [zxcvbn](https://github.com/dropbox/zxcvbn) by [@dropbox](https://github.com/dropbox).
|
||||
|
||||
## Install
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ This is a bit more interesting. `zxcvbn_dictionary` allows you to input both the
|
|||
'email' => 'trash@thedumpster.com'
|
||||
];
|
||||
$validator = Validator::make($password, [
|
||||
'password' => 'zxcvbn_dictionary:' . $data['username'] . ',' . $data['email'] . '|required',
|
||||
'password' => sprintf('required|zxcvbn_dictionary:%s,%s', $data['username'], $data['email'])
|
||||
]);
|
||||
|
||||
dd($validator->passes());
|
||||
|
|
@ -125,7 +125,7 @@ This is a bit more interesting. `zxcvbn_dictionary` allows you to input both the
|
|||
'email' => 'mycomplicatedphrase@thedumpster.com'
|
||||
];
|
||||
$validator = Validator::make($password, [
|
||||
'password' => 'zxcvbn_dictionary:' . $data['username'] . ',' . $data['email'] . '|required',
|
||||
'password' => sprintf('required|zxcvbn_dictionary:%s,%s', $data['username'], $data['email'])
|
||||
]);
|
||||
|
||||
dd($validator->passes());
|
||||
|
|
@ -148,7 +148,7 @@ $ phpunit
|
|||
|
||||
The MIT License (MIT). Please see the [License File](LICENSE.md) for more information.
|
||||
|
||||
© 2019 [Marcus Olsson](https://marcusolsson.me).
|
||||
© 2020 [Marcus Olsson](https://marcusolsson.me).
|
||||
|
||||
[ico-version]: https://img.shields.io/packagist/v/olssonm/l5-zxcvbn.svg?style=flat-square
|
||||
|
||||
|
|
|
|||
|
|
@ -20,13 +20,13 @@
|
|||
}
|
||||
],
|
||||
"require": {
|
||||
"php" : "^7.1",
|
||||
"illuminate/support": ">=5.8|^6.0|^7.0|^8.0",
|
||||
"mkopinsky/zxcvbn-php": "^4.4"
|
||||
"php": "^7.3|^8.0",
|
||||
"illuminate/support": "^6.0|^7.0|^8.0",
|
||||
"bjeavons/zxcvbn-php": "^1.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^7.5 || ^8.0",
|
||||
"orchestra/testbench": ">=3.4.0"
|
||||
"phpunit/phpunit": "^8.0|^9.0",
|
||||
"orchestra/testbench": ">=4.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class ZxcvbnServiceProvider extends ServiceProvider
|
|||
});
|
||||
|
||||
/**
|
||||
* Extend the Laravel Validator with the "zxcvbn_min" rule
|
||||
* Extend the Laravel Validator with the "zxcvbn_dictionary" rule
|
||||
*/
|
||||
Validator::extend('zxcvbn_dictionary', function($attribute, $value, $parameters) {
|
||||
$email = null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue