Skip to content

Commit

Permalink
fix callable password defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jun 11, 2021
1 parent 019277c commit 0b1610f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Illuminate/Validation/Rules/Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ public static function defaults($callback = null)
*/
public static function default()
{
$password = value(static::$defaultCallback);
$password = is_callable(static::$defaultCallback)
? call_user_func(static::$defaultCallback)
: static::$defaultCallback;

return $password instanceof Rule ? $password : static::min(8);
}
Expand Down

0 comments on commit 0b1610f

Please sign in to comment.