I am uploading multiple images and sometimes it works fine and another crashes, other times it does not take certain images and redirects me to the 404 page. I would like if you can give me a hand. I really appreciate any intention.
I am using Livewire as follows:
<input wire:model="imagenes" type="file" name="imagenes" class="form-control-file" multiple>
Once the images are selected, go through the validator:
$this->validate([
'imagenes.*' => 'image|max:2048',
]);
And to save the images I am using the following methodology
foreach ($this->imagenes as $pathGaleria) {
$imgUrl = $pathGaleria->store('imagenesPropiedades');
$img = imgPropiedades::create([
'url' => $imgUrl,
'property_id' => $this->propiedadId
]);
}
On the file system:
'imagenesPropiedades' => [
'driver' => 'local',
'root' => public_path(),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
I am getting this error in console
Can you give me a suggestion to improve this load please.
The problem was that since I use livewire in real time, I had not considered the enctype="multipart/form-data" tag, and I also had to expand the max_upload server spaces. Thank you very much