src/DumbPasswordServiceProvider.php
public function boot()
    {
        Validator::extend('dumbpwd', function ($attribute, $value, $parameters, $validator) {
            $path = realpath(__DIR__ . '/../resources/config/passwordlist.txt');
            $cache_key = md5_file($path);
            $data = Cache::rememberForever('dumbpwd_list_' . $cache_key, function () use ($path) {
                return collect(explode("\n", file_get_contents($path)));
            });
            return !$data->contains($value);
        }, $this->message);
    }
public function boot()
    {
        Validator::extend('dumbpwd', function ($attribute, $value, $parameters, $validator) {
            $path = realpath(__DIR__ . '/../resources/config/passwordlist.txt');
            $cache_key = md5_file($path);
            $data = Cache::rememberForever('dumbpwd_list_' . $cache_key, function () use ($path) {
                return collect(explode("\n", file_get_contents($path)));
            });
            return !$data->contains($value);
        }, $this->message);
    }
public function boot ( ) { Validator :: extend ( 'dumbpwd' , function ( $ attribute , $ value , $ parameters , $ validator ) { $ path = realpath ( __DIR__ . '/../resources/config/passwordlist.txt' ) ; $ cache_key = md5_file ( $ path ) ; $ data = Cache :: rememberForever ( 'dumbpwd_list_' . $ cache_key , function ( ) use ( $ path ) { return collect ( explode ( "\n" , file_get_contents ( $ path ) ) ) ; } ) ; return ! $ data -> contains ( $ value ) ; } , $ this -> message ) ; }
Publishes all the config file this package needs to function.
Publishes all the config file this package needs to function .