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
@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.
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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community