Skip to content

UsersTable doesn't have any email validation rules #1106

Description

@miftygusein

Shouldn't \CakeDC\Users\Model\Table\UsersTable offer validation rules for email?

\Cake\Validation\Validator::email() can be used. (CakePHP Book → Modelless Forms → Creating a Form is an example.)

For an experiment, I added:

$validator
    ->email('email');

... right here:

public function validationDefault(Validator $validator): Validator

Worked perfectly for me, but I understand I'm probably missing a bigger picture as this could be not for every use case.

And yet, for a rather common use case where email is needed, I would argue the plugin should somehow recognise it and enable the email validation out of the box.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions