Livewire

File Uploads in Livewire v4: Complete Tutorial

February 01, 2026 1 min read 17 views

Livewire v4 makes file uploads simple.

Component

use Livewire\WithFileUploads;

class PhotoUpload extends Component
{
    use WithFileUploads;
    
    #[Validate('image|max:1024')]
    public $photo;
    
    public function save(): void
    {
        $this->validate();
        $this->photo->store('photos', 'public');
    }
}

Template


Uploading...
Share this post:

Related Posts

Comments (0)

Please log in to leave a comment. Log in

No comments yet. Be the first to comment!