Answer the question
In order to leave comments, you need to log in
How to check form field value in laravel for absence in MYSQL table?
The method for checking the input field for existence in the table in laravel is: https://laravel.com/docs/8.x/validation#rule-exists
And I need to understand if the email is in the table, and only then redirect the user to your personal account. Here's how it doesn't work: 'email' => '!exists:users'
However, I want to use laravel's normal validation. For example, in a class for a specific request, write the following code:
return [
'email' => 'required|email',
'password' => 'required|confirmed|min:8',
'email' => '!exists:users'
];
Then - pass the request class object to the controller in the method that is associated with the URL that the controller processes. Answer the question
In order to leave comments, you need to log in
You can continue reading the section on validation and learn about three types of custom rules with which you can do any kind of validation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question