Get all field data after form submit in Livewire

Here is a first way, you could actually do this right now:

<form wire:submit.prevent="submit(Object.fromEntries(new FormData($">
    <input type="text" name="foo">
    <input type="text" name="bar">


Then, in your component, here’s the submit method:

public function submit($formData)

After typing in “baz” and “bob” into the inputs and submitting, this will output:

Leave a Reply

Your email address will not be published. Required fields are marked *