you should use the rules from Cake ORM in your table ...
add this at the top of your UsersTable account after your namespace
use Cake\ORM\Rule\IsUnique;
Then prepare your rule to apply to your field by placing it in an open function
public function buildRules(RulesChecker $rules){ $rules->add($rules->isUnique(['email'])); return $rules; }
Refer to cakephp documentation for more information on RULES
source share