File: D:/HostingSpaces/SBogers10/base.komma.pro/vendor/komma/kms/src/Auth/AuthValidationHelper.php
<?php declare(strict_types=1);
namespace Komma\KMS\Auth;
class AuthValidationHelper
{
/**
* Get the password reset validation rules.
*
* @return array
*/
public static function resetRules()
{
return [
'token' => 'required',
'email' => 'required|email',
'password' => self::passwordRules().'|confirmed',
];
}
/**
* Get the password reset validation messages.
*
* @return array
*/
public static function resetMessages()
{
return [
'required' => trans('KMS::validation.required'),
'email' => trans('KMS::validation.email'),
'confirmed' => trans('KMS::validation.confirmed'),
'min' => trans('KMS::validation.min'),
'password.regex' => trans('KMS::validation.custom.password.regex'),
];
}
/**
* The rules for setting a password with a single password field
*
* @return array
*/
public static function setRules() {
return [
'password' => self::passwordRules(),
];
}
/**
* The special characters allowed in a password. But for displaying them to the user
*
* @return string
*/
public static function allowedSpecialCharacters() {
return '!@#$%^&*()_-+:;,.?';
}
/**
* The special characters allowed in a password. But for use in regex
*/
public static function allowedSpecialCharactersForRegex() {
return '!@#$%^&*()_\-+:;,.?';
}
/**
* Returns the minimum password length
*/
public static function minLength()
{
return 8;
}
/**
* @return string
*/
private static function passwordRules() {
return 'required|min:'.self::minLength().'|regex:/^[a-zA-Z0-9'.self::allowedSpecialCharactersForRegex().']+$/';
}
}