Skip to content

Commit b264eb0

Browse files
feat(laravel-password): Add password check functionality
1 parent 2c33da9 commit b264eb0

File tree

4 files changed

+10121
-51
lines changed

4 files changed

+10121
-51
lines changed

README.md

+64-25
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,89 @@
1-
# :package_name
1+
# laravel-password
22

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+
[![Latest Stable Version](https://poser.pugx.org/unicodeveloper/laravel-password/v/stable.svg)](https://packagist.org/packages/unicodeveloper/laravel-password)
4+
[![License](https://poser.pugx.org/unicodeveloper/laravel-password/license.svg)](LICENSE.md)
5+
[![Quality Score](https://img.shields.io/scrutinizer/g/unicodeveloper/laravel-password.svg?style=flat-square)](https://scrutinizer-ci.com/g/unicodeveloper/laravel-password)
6+
[![Total Downloads](https://img.shields.io/packagist/dt/unicodeveloper/laravel-password.svg?style=flat-square)](https://packagist.org/packages/unicodeveloper/laravel-password)
97

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
129
13-
## Install
10+
### Introduction
1411

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)
1617

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.*"
1927
```
2028

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+
2235

23-
``` php
36+
## Usage
2437

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+
}
2555
```
2656

27-
## Change log
57+
Results happen like so:
2858

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!`.
3064

31-
## Testing
65+
You can customize the error message by opening `resources/lang/en/validation.php` and adding it like so:
3266

33-
``` bash
34-
$ composer test
67+
```php
68+
'dumbpwd' => 'You are using a dumb password abeg',
3569
```
3670

71+
## Change log
72+
73+
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
74+
3775
## Contributing
3876

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.
4078

41-
## Security
79+
## How can I thank you?
4280

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!
4482

45-
## Credits
83+
Don't forget to [follow me on twitter](https://twitter.com/unicodeveloper)!
4684

47-
- [Prosper Otemuyiwa][https://twitter.com/unicodeveloper]
85+
Thanks!
86+
Prosper Otemuyiwa.
4887

4988
## License
5089

0 commit comments

Comments
 (0)