1. Go to this page and download the library: Download crumbls/common-passwords library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => ['
// Take a random user. You should be more pointed than this.
$user = \App\Models\User::inRandomOrder()->take(1)->first();
$passwords = \Crumbls\CommonPasswords\Models\Password::orderBy(
with(new \Crumbls\CommonPasswords\Models\Password())->getKeyName(),
'asc'
)->get();
foreach($passwords as $password) {
if (\Hash::check($password->password, $user->password)) {
printf('User had an invalid password: %s .', $password->password);
break;
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.