Hi im trying to upload multiple files at once in angular 8 and laravel api. I am able to store single image using this code.. Angular code:
<input type="file" name="image" (change)="uploadImage($event)">
uploadImage(event) {
console.log(event);
this.img = <File>event.target.files[0];
}
const formdata = new FormData();
formdata.append('image', this.img, this.img.name);
Laravel code: this is how i move image to a folder and then store name into database..
$img = $request->file('image');
$image = str_random(10).time().'.'.$img->getClientOriginalExtension();
$destination = 'assets/images/';
$img->move($destination, $image);
How can i do this for multiple files at once?