2017 © Pedro Peláez
 

library laravel-pwned-passwords

PwnedPasswords for Laravel 5

image

nickurt/laravel-pwned-passwords

PwnedPasswords for Laravel 5

  • Tuesday, February 27, 2018
  • by nickurt
  • Repository
  • 3 Watchers
  • 14 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Laravel Pwned Passwords

Build Status Total Downloads Latest Stable Version MIT Licensed, (*1)

Installation

Install this package with composer:, (*2)

composer require nickurt/laravel-pwned-passwords

Copy the config files for the PwnedPasswords-plugin, (*3)

php artisan vendor:publish --provider="nickurt\PwnedPasswords\ServiceProvider" --tag="config"

Examples

Validation Rule - IsPwnedPassword

// FormRequest ...

public function rules()
{
    return [
        'password' => ['required', new \nickurt\PwnedPasswords\Rules\IsPwnedPassword(20)]
    ];
}

// Manually ...

$validator = validator()->make(request()->all(), ['password' => ['required', new \nickurt\PwnedPasswords\Rules\IsPwnedPassword(20)]]);

The IsPwnedPassword-rule has one optional paramter frequency (default 10) to validate the request., (*4)

Manually Usage - IsPwnedPassword

$isPwnedPassword = \PwnedPasswords::setFrequency(20)
    ->setPassword('laravel-pwned-passwords')
    ->isPwnedPassword();

Events

You can listen to the IsPwnedPassword event, e.g. if you want to log the IsPwnedPassword-requests in your application, (*5)

IsPwnedPassword Event

This event will be fired when the password is above the frequency of pwned passwords nickurt\PwnedPasswords\Events\IsPwnedPassword, (*6)

Tests

composer test

The Versions

27/02 2018

dev-master

9999999-dev

PwnedPasswords for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel haveibeenpwned pwned-passwords

27/02 2018

1.0

1.0.0.0

PwnedPasswords for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel haveibeenpwned pwned-passwords