معاينة الصورة مع Livewire:
المكون
use WithFileUploads;
public $photo;
public function save()
{
$this->validate([
'photo' => 'image|max:1024',
]);
$this->photo->store('photos');
}العرض
<input type="file" wire:model="photo">
@if ($photo)
<img src="{{ $photo->temporaryUrl() }}">
@endif
<button wire:click="save">حفظ</button>مع التحميل
<div wire:loading wire:target="photo">
جاري الرفع...
</div>