Skip to content

Passes method of custom validation rule receives array keys with dotPlaceholder #34263

@PiranhaGeorge

Description

@PiranhaGeorge
  • Laravel Version: 8
  • PHP Version: 7.4
  • Database Driver & Version: n/a

Description:

When validating an array with a custom validation Rule, the $value param of the rule's passes() method receives the array with dot placeholders included in keys. This makes it impossible to validate array keys containing dots.

Related to #33357

Steps To Reproduce:

Send a request with an array query parameter that has keys containing dots e.g. foo[foo.bar]=baz

Validate with a custom validation rule e.g. ['foo' => new CustomRule()]

dd() the $value param of the passes() method and the result will be something like: ['fooP0gffDX4ilGw68H6bar' => 'baz']

Metadata

Metadata

Assignees

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