0
0
0ldn0mad2019-09-10 21:09:06
Laravel
0ldn0mad, 2019-09-10 21:09:06

Is it possible to check a regular expression in a method?

Good afternoon.
Is it possible to check the data coming from the form with a regular expression in the method?
For example:

if ($request->has('email')) 
   $email = $request->input('email');

Is it possible to check the correctness of the email address from the email variable along the way?
I know that you can customize the validation using the form, but here and now there is such a condition!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2019-09-10
@0ldn0mad

What prevents you from making a Request class with validation or calling a validator right here?
Not to mention the most common validation methods in php , if you don’t look at the Laravel doc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question