Level 8
Are you wrapping the form with a wire:submit.prevent="save"?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi everyone,
I'm using Livewire 3 with WithFileUploads to handle file uploads in my form. However, after selecting a file, the page refreshes unexpectedly, causing some input scripts (like date pickers) to not work correctly.
I'm using Laravel Volt with Livewire 3 and WithFileUploads. Below is my component setup:
use Livewire\Attributes\Layout;
use Livewire\WithFileUploads;
use Livewire\Volt\Component;
use Illuminate\Support\Facades\Auth;
new #[Layout('components.layouts.app')] class extends Component {
use WithFileUploads;
public $form = [
'activity_type_id' => '',
'date' => '',
'activities' => [
[
'activity' => '',
'output' => '',
'volume' => '',
'unit' => '',
'note' => '',
'location' => true,
'proof' => null,
]
]
];
public function save()
{
$this->validate([
'form.activities.*.proof' => 'nullable|file|max:10240',
]);
session()->flash('success', 'Activities created successfully.');
return redirect()->route('activity');
}
};
<input
type="file"
wire:model="form.activities.{{ $index }}.proof"
class="input w-full"
id="proof-{{ $index }}"
/>
Issue
What I've Tried
Questions
Any insights would be appreciated! Thanks! 🙏
Are you wrapping the form with a wire:submit.prevent="save"?
Please or to participate in this conversation.