My current functionality allows adding multiple images, the problem I get is that if the user presses the image loading button again, it replaces the previous ones. How would be the way to allow the user to add more images to the gallery?
View:
<input wire:model="imagenes" type="file" name="imagenes" accept="image/*" class="form-control-file" multiple>
Component:
foreach ($this->imagenes as $pathGaleria) {
$imagenes = $pathGaleria;
$nombre = Str::random(10) . $imagenes->getClientOriginalName();
$ruta = public_path() . '\imagenesPropiedades/' . $nombre;
Image::make($pathGaleria)
->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
})
->save($ruta);
$img = imgPropiedades::create([
'url' => '/imagenesPropiedades/' . $nombre,
'property_id' => $this->propiedadId
]);
}
Thank you for spending your time in my consultation.