Skip to content

Commit

Permalink
Update styling
Browse files Browse the repository at this point in the history
  • Loading branch information
juukie committed Jul 14, 2016
1 parent 52a286e commit c340e0f
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions src/DumbPasswordServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,47 +16,40 @@

class DumbPasswordServiceProvider extends ServiceProvider
{

/*
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;

/**
* default error message
* Default error message.
*
* @var string
*/
protected $message = 'This password is just too common. Please try another!';

/**
* Publishes all the config file this package needs to function
*/
* Publishes all the config file this package needs to function.
*/
public function boot()
{
$path = realpath(__DIR__.'/../resources/config/passwordlist.txt');
$dumbPasswords = collect(explode("\n", file_get_contents($path)));
$data = $dumbPasswords->flip();

Validator::extend('dumbpwd', function($attribute, $value, $parameters, $validator) use ($data) {
Validator::extend('dumbpwd', function ($attribute, $value, $parameters, $validator) use ($data) {
return !$data->has($value);
}, $this->message);
}, $this->message);
}

/**
* Register the application services.
*/
* Register the application services.
*/
public function register()
{

//
}

/**
* Get the services provided by the provider
* @return array
*/
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return ['laravel-password'];
Expand Down

0 comments on commit c340e0f

Please sign in to comment.