for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace Anomaly\UsersModule\User\Password;
/**
* Class ForgotPasswordFormFields
*
* @link http://pyrocms.com/
* @author PyroCMS, Inc. <[email protected]>
* @author Ryan Thompson <[email protected]>
*/
class ChangePasswordFormFields
{
* Handle the fields.
* @param ChangePasswordFormBuilder $builder
public function handle(ChangePasswordFormBuilder $builder)
$builder->setFields(
[
'password_old' => [
'type' => 'anomaly.field_type.text',
'label' => 'anomaly.module.users::field.password_old.name',
'config' => [
'type' => 'password',
],
'required' => true,
'rules' => [
'required|valid_password_old',
'validators' => [
'valid_password_old' => [
'handler' => 'Anomaly\UsersModule\User\Validation\ValidateCurrentPassword@handle',
'message' => 'anomaly.module.users::message.invalid_password_old',
'password_new' => [
'label' => 'anomaly.module.users::field.password_new.name',
'confirmed',
'password_new_confirmation' => [
]
);
}