Skip to content
Discussion options

You must be logged in to vote

@develgold Just tested your example

public function testValidatedMethodShowsAllValidatedFields() {
        $data = [
            'name' => 'string',
            'items' => [
                [
                    'id' => 1
                ]
            ],
            'not_shown_key' => 'myString'
        ];

        $rules = [
            'name' => 'string',
            'items.*.id' => 'integer'
        ];

        $trans = $this->getIlluminateArrayTranslator();

        $validator = new Validator($trans, $data, $rules);

        $result = $validator->validated();

        $this->assertArrayHasKey('name', $result);

        $this->assertArrayHasKey('items', $result);

        $this->assert…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@develgold
Comment options

Answer selected by develgold
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #40882 on February 09, 2022 08:45.