Skip to content

[5.2.29] Array validation : Required with #13047

@azorgh

Description

@azorgh

Hello everybody.

I'm trying to use array validation introduced in Laravel 5.2.
But I think a bug is present. In fact, there is my array received by the request (debugged after my form submission) :

array:2 [▼
  "_token" => "oqsdgfxcGBSmxjaZO40wBmnYHfivaHv3"
  "fields" => array:2 [▼
    "fr" => array:3 [▼
      "name" => ""
      "slug" => ""
      "content" => "qdzd"
    ]
    "es" => array:3 [▼
      "name" => ""
      "slug" => ""
      "content" => ""
    ]
  ]
]

In my validation rules, I doing this :

return [
    'fields.*.content' => 'required_with:fields.*.name'
];

Normally in this case, the validation failed on the fields[fr][content], because the name was not set yet right ?

I'm so sorry if the bug is provided by between my chair and my desktop ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions