I have simplified my form for this question.
This is my example
<form method="post" name="test" enctype="multipart/form-data">
{{csrf_field()}}
<input class="form-control" type="file" name="test[]" id="companion"/>
<input type="hidden" name="test[]" value="random-value" />
<input type="submit" value="Submit">
</form>
In my route a just dd the request as follow:
dd(request('test'));
Now I would expect an array with a file (UploadedFile type) and the random-value, instead, I'm getting only the file.
array:1 [▼
0 => UploadedFile {#539 ▶}
]
Any idea why I'm getting this result? I know that I can change the name of the variables, but I wanna understand why it doesn't work like that.
Thanks in advance.