Support the ongoing development of Laravel.io →
Blade Eloquent Routing
0

You can use named routes instead and pass the model as a parameter to the route. note you dont need to specify the id as laravel route model binding will take care of that for you providing you setup the routes and controller correctly.

https://laravel.com/docs/11.x/routing#named-routes https://laravel.com/docs/11.x/routing#generating-urls-to-named-routes

<form method="post" action="{{ $model->exists ? route('mymodels.update', $model) : route('mymodels.create') }}">
    @csrf
    @method($model->exists ? 'PATCH' : 'POST')

binoyav83, hrios liked this reply

2
moderator

@lcallif You post a link to YouTube for a livewire video. Can you explain what you want to say? Because currently it doesn't really match the question.

0

This is a video explaining one way to perform a create/edit in one form. I felt, still do, that this may assist the original poster in accomplishing his/her requirements.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.