Image preview with Livewire:
Component
use WithFileUploads;
public $photo;
public function save()
{
$this->validate([
'photo' => 'image|max:1024',
]);
$this->photo->store('photos');
}View
<input type="file" wire:model="photo">
@if ($photo)
<img src="{{ $photo->temporaryUrl() }}">
@endif
<button wire:click="save">Save</button>With Loading
<div wire:loading wire:target="photo">
Uploading...
</div>