Fly.io can build and run your Laravel apps globally. Deploy your https://fly.io/docs/laravel/ on Fly.io, you’ll be up and running in minutes!

Instead of jamming form “stuff” into our Livewire component, we can create a new Form object: php artisan livewire:form SnackRequestForm

Then, in our component, we can use that form: namespace App\Livewire; use Livewire\Component; use App\Models\SnackRequest; use App\Livewire\Forms\SnackRequestForm; class SnackRequest extends Component { public SnackRequestForm $form; public function save() { SnackRequest::create( $this->form->all()); return $this->redirect('/requests'); } public function render() { return view('livewire.request-snack'); }}

The component: public function save() { + $this->form->submit(); - SnackRequest::create( - $this->form->all() - ); return $this->redirect('/requests'); }
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners