|
1 |
| -# :package_name |
| 1 | +# laravel-password |
2 | 2 |
|
3 |
| -[![Latest Version on Packagist][ico-version]][link-packagist] |
4 |
| -[![Software License][ico-license]](LICENSE.md) |
5 |
| -[![Build Status][ico-travis]][link-travis] |
6 |
| -[![Coverage Status][ico-scrutinizer]][link-scrutinizer] |
7 |
| -[![Quality Score][ico-code-quality]][link-code-quality] |
8 |
| -[![Total Downloads][ico-downloads]][link-downloads] |
| 3 | +[](https://packagist.org/packages/unicodeveloper/laravel-password) |
| 4 | +[](LICENSE.md) |
| 5 | +[](https://scrutinizer-ci.com/g/unicodeveloper/laravel-password) |
| 6 | +[](https://packagist.org/packages/unicodeveloper/laravel-password) |
9 | 7 |
|
10 |
| -This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what |
11 |
| -PSRs you support to avoid any confusion with users and contributors. |
| 8 | +> #### Guard your users from security problems such as being hacked that start by having dumb passwords |
12 | 9 |
|
13 |
| -## Install |
| 10 | +### Introduction |
14 | 11 |
|
15 |
| -Via Composer |
| 12 | +This package can be used to verify **the user provided password is |
| 13 | +not one of the top 10,000 worst passwords** as analyzed by a respectable IT security analyst. Read |
| 14 | +about all [ here](https://xato.net/10-000-top-passwords-6d6380716fe0#.473dkcjfm), |
| 15 | +[here(wired)](http://www.wired.com/2013/12/web-semantics-the-ten-thousand-worst-passwords/) or |
| 16 | +[here(telegram)](http://www.telegraph.co.uk/technology/internet-security/10303159/Most-common-and-hackable-passwords-on-the-internet.html) |
16 | 17 |
|
17 |
| -``` bash |
18 |
| -$ composer require unicodeveloper/laravel-password |
| 18 | + |
| 19 | +## Installation |
| 20 | + |
| 21 | +[PHP](https://php.net) 5.5+ or [HHVM](http://hhvm.com) 3.3+, and [Composer](https://getcomposer.org) are required. |
| 22 | + |
| 23 | +To get the latest version of Laravel Password, simply add the following line to the require block of your `composer.json` file. |
| 24 | + |
| 25 | +``` |
| 26 | +"unicodeveloper/laravel-password": "1.0.*" |
19 | 27 | ```
|
20 | 28 |
|
21 |
| -## Usage |
| 29 | +You'll then need to run `composer install` or `composer update` to download it and have the autoloader updated. |
| 30 | + |
| 31 | +Once Laravel Password is installed, you need to register the service provider. Open up `config/app.php` and add the following to the `providers` key. |
| 32 | + |
| 33 | +* `Unicodeveloper\DumbPassword\DumbPasswordServiceProvider::class` |
| 34 | + |
22 | 35 |
|
23 |
| -``` php |
| 36 | +## Usage |
24 | 37 |
|
| 38 | +Use the rule `dumbpwd` in your validation like so: |
| 39 | + |
| 40 | +```php |
| 41 | +/** |
| 42 | + * Get a validator for an incoming registration request. |
| 43 | + * |
| 44 | + * @param array $data |
| 45 | + * @return \Illuminate\Contracts\Validation\Validator |
| 46 | + */ |
| 47 | +protected function validator(array $data) |
| 48 | +{ |
| 49 | + return Validator::make($data, [ |
| 50 | + 'name' => 'required|max:255', |
| 51 | + 'email' => 'required|email|max:255|unique:users', |
| 52 | + 'password' => 'required|min:6|dumbpwd|confirmed', |
| 53 | + ]); |
| 54 | +} |
25 | 55 | ```
|
26 | 56 |
|
27 |
| -## Change log |
| 57 | +Results happen like so: |
28 | 58 |
|
29 |
| -Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. |
| 59 | +<img width="1101" alt="screen shot 2016-07-02 at 1 10 22 pm" src="https://cloud.githubusercontent.com/assets/2946769/16540466/be96cd5c-405d-11e6-9412-35a89da03edd.png"> |
| 60 | + |
| 61 | +<img width="1095" alt="screen shot 2016-07-02 at 1 22 45 pm" src="https://cloud.githubusercontent.com/assets/2946769/16540468/c6bd71f2-405d-11e6-8f34-d3a9b1b27e77.png"> |
| 62 | + |
| 63 | +By default, the error message returned is `This password is just too common. Please try another!`. |
30 | 64 |
|
31 |
| -## Testing |
| 65 | +You can customize the error message by opening `resources/lang/en/validation.php` and adding it like so: |
32 | 66 |
|
33 |
| -``` bash |
34 |
| -$ composer test |
| 67 | +```php |
| 68 | + 'dumbpwd' => 'You are using a dumb password abeg', |
35 | 69 | ```
|
36 | 70 |
|
| 71 | +## Change log |
| 72 | + |
| 73 | +Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. |
| 74 | + |
37 | 75 | ## Contributing
|
38 | 76 |
|
39 |
| -Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details. |
| 77 | +Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities. |
40 | 78 |
|
41 |
| -## Security |
| 79 | +## How can I thank you? |
42 | 80 |
|
43 |
| -If you discover any security related issues, please email [email protected] instead of using the issue tracker. |
| 81 | +Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word! |
44 | 82 |
|
45 |
| -## Credits |
| 83 | +Don't forget to [follow me on twitter](https://twitter.com/unicodeveloper)! |
46 | 84 |
|
47 |
| -- [Prosper Otemuyiwa][https://twitter.com/unicodeveloper] |
| 85 | +Thanks! |
| 86 | +Prosper Otemuyiwa. |
48 | 87 |
|
49 | 88 | ## License
|
50 | 89 |
|
|
0 commit comments