Skip to content

Commit

Permalink
Include default plugin config
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Georges committed Sep 1, 2019
1 parent 49dfee2 commit d9a93a8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
11 changes: 11 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php return [
/*
|--------------------------------------------------------------------------
| Minimum Password Length
|--------------------------------------------------------------------------
|
| The minimum length of characters required for user passwords.
|
*/
'minPasswordLength' => 8,
];
7 changes: 3 additions & 4 deletions models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class User extends UserBase
'email' => 'required|between:6,255|email|unique:users',
'avatar' => 'nullable|image|max:4000',
'username' => 'required|between:2,255|unique:users',
'password' => 'required:create|between:' . UserSettings::MIN_PASSWORD_LENGTH_DEFAULT . ',255|confirmed',
'password_confirmation' => 'required_with:password|between:' . UserSettings::MIN_PASSWORD_LENGTH_DEFAULT . ',255',
'password' => 'required:create|between:8,255|confirmed',
'password_confirmation' => 'required_with:password|between:8,255',
];

/**
Expand Down Expand Up @@ -202,7 +202,7 @@ public function getLoginName()
*/
public static function getMinPasswordLength()
{
return Config::get('min_password_length', 8);
return Config::get('rainlab.user::minPasswordLength', 8);
}

//
Expand Down Expand Up @@ -248,7 +248,6 @@ public function beforeValidate()
$this->username = $this->email;
}


/*
* Apply Password Length Settings
*/
Expand Down

0 comments on commit d9a93a8

Please sign in to comment.