1

Why a wrong email is accepted even after using laravel validator?

$validator = Validator::make($request->all(), [            
            'email' => 'required|email|unique:users',
        ]);

        if ($validator->fails()) {
            return ResponseBuilder::error($validator->errors()->first(), '422');
        }

This set of code accepts "@ot.com". I don't think this should be accepted.

apokryfos
  • 38,771
  • 9
  • 70
  • 114
  • Just checked within tinker and such validation passes. `\Illuminate\Validation\Factory::make(['email' => ' @ot.co'], ['email' => 'required|email'])->passes()` You may discuss it right within laravel framework repo: https://github.com/laravel/framework/discussions/categories/general – Denys Klymenko Feb 12 '21 at 07:50

0 Answers0