Skip to content

Conversation

@rabrowne85
Copy link

It is not possible to have a request factory where a key has an array of files e.g.,:

public function files(): array
{
    return [
        'documents' => [
            $this->image('file.jpg'),
            $this->image('file2.jpg'),
            $this->file('file.pdf'),
        ],
    ];
}

This PR adds support for this by updating the Result.php to adjust the filtering of inputs() and files() such that arrays of files are found in files() and NOT in inputs(). This does not appear to break existing tests and should be backwardly compatible.

This ensures that the files are passed correctly in the request and thus can be found by the controller.

I've adjusted the test suite to add new checks for the array of files, and existing tests continue to pass.

@rabrowne85 rabrowne85 marked this pull request as draft May 2, 2025 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant