livewire-file-uploads

star 0

Adds file upload capability to Livewire form components. Handles temporary storage, validation, and persisting uploads.

naykel76 By naykel76 schedule Updated 2/11/2026

name: livewire-file-uploads description: >- Adds file upload capability to Livewire form components. Handles temporary storage, validation, and persisting uploads.

Livewire File Upload

File uploads use FilePond, a JavaScript library that provides drag-and-drop, previews, and progress indicators. It integrates with Livewire's temporary upload system.

Activate this skill when:

  • Forms need image/file upload fields

Setup

Add WithFileUploads trait to component:

use Livewire\WithFileUploads;

class CreateEdit extends Component
{
    use WithFormActions, WithFileUploads;
}

Use on component, not form object.

Add filepond to view:

<x-gt-filepond wire:model="form.tmpUpload" />

Storage Configuration

Configure in form object:

public array $storage = [
    'disk' => 'media',
    'dbColumn' => 'image_name',
    'path' => 'uploads/images',
];

Image Preview

public function featuredImageUrl()
{
    return $this->image_name
        ? Storage::disk('media')->url($this->image_name)
        : url('/svg/placeholder.svg');
}

View:

<img src="{{ $this->imageUrl() }}" alt="{{ $form->title }}">

Component method:

public function imageUrl()
{
    return $this->form->tmpUpload?->temporaryUrl()
        ?? $this->form->editing?->featuredImageUrl()
        ?? url('/svg/placeholder.svg');
}
Install via CLI
npx skills add https://github.com/naykel76/gotime_site --skill livewire-file-uploads
Repository Details
star Stars 0
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator