R
R
Roman2020-02-29 02:29:25
Laravel
Roman, 2020-02-29 02:29:25

How in laravel to find out if the input passed the validation or not?

I am validating the form Validator::make

After successfully checking the value of one field, send another field for verification. Suppose after validation , with successful validation of this field, it will be necessary to proceed with the validation (Since the data for validation second is associated with data from first) How can I implement this? <input name="first"><input name="second">

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Y
Yuri Kulaxyz, 2020-02-29
@Kulaxyz

Look here , if this is not the case, then there is a lot of everything in the documentation, read carefully, something will definitely suit you

S
Shamil Mardanzade, 2020-02-29
@Anonym247

In my opinion, you can check this way, but I'm not sure if the method is professional.

$error = Validator::make($request, [
                'first' => 'required|numeric|max:255......'
                 ];
if(!$error)
   .......

Here you can already pass the validation for the second minute.

M
Mokhirjon Naimov, 2020-02-29
@zvermafia

Available Validation Rules: bail

Stop running validation rules after the first validation failure.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question