Skip to content
Advertisement

How validate an array with a dot in key name ? (Laravel)

How can I validate this array in laravel validation:

JavaScript

I tried to use this, but it does’t working:

JavaScript

How can I solve? I want to note that: I have no choice to change the name “price.value”.

Advertisement

Answer

As you cannot change the name price.value you have to escape the dot since in Laravel array validation a dot means a nested level. Try to escape the. with
Your data:

JavaScript

Validation rule with dot escaped:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement