Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🔐 😈 Guard your users against entering dumb passwords in your Laravel 5 apps

License

NotificationsYou must be signed in to change notification settings

unicodeveloper/laravel-password

Repository files navigation

Latest Stable VersionLicenseQuality ScoreTotal Downloads

Guard your users from security problems by preventing them from having dumb passwords

Introduction

This package can be used to verifythe user provided password isnot one of the top 10,000 worst passwords as analyzed by a respectable IT security analyst. Readabout all here,here(wired) orhere(telegram)

Installation

PHP 5.5+ orHHVM 3.3+, andComposer are required.

To get the latest version of Laravel Password, simply add the following line to the require block of yourcomposer.json file.

"unicodeveloper/laravel-password": "1.0.*"

You'll then need to runcomposer install orcomposer update to download it and have the autoloader updated.

  • If you're on Laravel 5.5 or above, that's all you need to do! Check out the usage examples below.
  • If you're on Laravel < 5.5, you'll need to register the service provider. Open upconfig/app.php and add the following to theproviders array:
Unicodeveloper\DumbPassword\DumbPasswordServiceProvider::class

Usage

Use the ruledumbpwd in your validation like so:

/** * Get a validator for an incoming registration request. * * @param  array  $data * @return \Illuminate\Contracts\Validation\Validator */protectedfunctionvalidator(array$data){return Validator::make($data, ['name' =>'required|max:255','email' =>'required|email|max:255|unique:users','password' =>'required|min:6|dumbpwd|confirmed',    ]);}

Error shows on the page like so:

screen shot 2016-07-02 at 1 22 45 pm

By default, the error message returned isThis password is just too common. Please try another!.

You can customize the error message by openingresources/lang/en/validation.php and adding to the array like so:

'dumbpwd' =>'You are using a dumb password abeg',

screen shot 2016-07-02 at 2 12 14 pm

Change log

Please seeCHANGELOG for more information on what has changed recently.

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.

Inspiration

How can I thank you?

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!

Don't forget tofollow me on twitter!

Thanks!Prosper Otemuyiwa.

License

The MIT License (MIT). Please seeLicense File for more information.

About

🔐 😈 Guard your users against entering dumb passwords in your Laravel 5 apps

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors9

Languages


[8]ページ先頭

©2009-2025 Movatter.jp