Level 102
You aren't saving a file anywhere? You use store() to save a file to disk https://laravel-livewire.com/docs/2.x/file-uploads
I am trying to implement dynamic input file upload in Livewire. I have done this so far, I couldn't get the result. Here is the code,
public function rules() {
return [
'page.elements.*.featured_image' => 'nullable|image'
]
}
public function store() {
$this->validate();
$this->page->save();
$this->page->elements->each->save();
}
@foreach($page->elements as $index => $el) {
<input type="file" wire:model.lazy="page.elements.{{ $index }}.featured_image" />
@endforeach
I tried to store the image in the local disk, Did I miss something? I have tried a couple of ways, unfortunately, nothing works for me.
Please or to participate in this conversation.