0

I have checked my credentials with an authenticator and want to check if the username exists in the phone or email column, but I don't know how.

Thanks for any ideas

For example:

$rules = [
        'email' => 'required|exists:users,[email, phone]'
    ];

    $messages = [
        'email.exists' => '......',
    ];

    Validator::make($request->all(), $rules, $messages)->validate();

1 Answer 1

1

Try this instead

$rules = [
    'email' => 'required|exists:users,email',
    'phone' => 'required|exists:users,phone',
];

$messages = [
    'email.exists' => '...',
    'phone.exists' => '...',
];
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.