dimanche 3 mars 2019

Laravel Array Validation Counts

Within my Laravel application, I'm trying to validate that two of my arrays in my request add up to a specific number.

array1 => [1],
array2 => [],

My total needed count for array1 and array 2 is 3. What is needed is to take the count of array1 and multiply that number by 2 and then add in the count array2.

So in the above example my validation should fail because (1*2) = 2 + 0 = 2 so does not equal 3.

How would this validation be constructed?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire