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.
Shouldn't
\CakeDC\Users\Model\Table\UsersTableoffer validation rules foremail?\Cake\Validation\Validator::email()can be used. (CakePHP Book → Modelless Forms → Creating a Form is an example.)For an experiment, I added:
... right here:
users/src/Model/Table/UsersTable.php
Line 138 in 9f9f49b
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.