woodynadobhar/laravel-stupid-password

A laravel package wrapper for northox/stupid-password

v1.0 2020-06-19 02:06 UTC

This package is auto-updated.

Last update: 2024-10-18 05:06:34 UTC


README

Latest Version on Packagist Total Downloads

A laravel package wrapper for northox/stupid-password.

Installation

Via Composer

$ composer require woodynadobhar/laravelstupidpassword

Add config

$ artisan vendor:publish

Usage

Automagically

In the relevant 'password' validation rule(s), add 'stupidpassword':

'password' => 'min:6|required_with:password_confirmation|same:password_confirmation|stupidpassword',

By hand

use WoodyNaDobhar\LaravelStupidPassword\LaravelStupidPassword;

$stupidPass = new LaravelStupidPassword(Config::get('laravelstupidpassword.max'), Config::get('laravelstupidpassword.environmentals'), null, null, config('laravelstupidpassword.options'));
if($stupidPass->validate($input['password']) === false) {
	$errors = '';
	foreach($stupidPass->getErrors() as $error) {
		$errors .= $error . '<br />';
	}
	Flash::error('Your password is weak:<br \>' . substr($errors, 0, -6));
	return redirect(URL::previous());
}

Package dependencies

This is a laravel wrapper for Northox Stupid Password

Change log

Please see the changelog for more information on what has changed recently.

Source

https://github.com/WoodyNaDobhar/laravel-stupid-password

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please contact northox instead of using the issue tracker.

Version

Versioning is for chumps.

Credits

License

BSD license. In other words, it's free software, almost free as in free beer.