I'm not sure if I'm supposed to be looping over the images in my Vue components before submitting the form via post request?
Yes. You only get the first image because on the @input handler you are just saving the first image form.images = $event.target.files[0]
Also, why are you binding both to the @input event, and to v-model? You can bind to both, but making both mutate the same prop (form.images) can lead to unexpected results like the one you are getting.
Try one of these: (ONE, not both)
- remove the
@inputhandler and leave just thev-model - remove the
v-modelhandler and change the@inputhandler to@input="form.images = event.target.files"
Inertia form helper should handle File objects automatically for you, per their docs:
When making visits that include files, Inertia will automatically convert the request data into a
FormDataobject.
reference: https://inertiajs.com/forms#file-uploads