Check that it actually has an ID. It might be null
Uncaught (in promise) Error: Ziggy error: 'id' parameter is required for route
Hi I am working inertia and laravel single page app. I am getting error as
Uncaught (in promise) Error: Ziggy error: 'id' parameter is required for route 'event-details.reservations.index'.
at 2:26
at String.replace (<anonymous>)
at t.e.compile (2:26)
at u.f.toString (2:26)
at Proxy.<anonymous> (2:26)
at Proxy.render (app.js:35286)
at renderComponentRoot (app.js:10573)
at ReactiveEffect.componentUpdateFn [as fn] (app.js:14320)
at ReactiveEffect.run (app.js:8965)
at setupRenderEffect (app.js:14446)
but I am passing all the routes.
I have one page called events and event-detail. In event page I am using the route like this
<Link
:href="
route('event-details.reservations.index', {
'language': $page.props.current_locale,
'id': id,
})
"
>
</Link>
my routes file
Route::group(['prefix' => '{language}'],function(){
Route::get('events',[HomeController::class,'event'])->name('events');
Route::get('events-details/{id}',[HomeController::class,'eventDetail'])->name('event-details.reservations.index');
})
when I click on this link then I am getting error that is in event-details page. I am not understanding where I am going wrong.
@shariff Ok. so if the error only comes on the second page, and it comes if you load it directly, lets ignore the first. So go to the second page and get the error. Then click the small triangle in front of the error, and see if you can locate what line triggers the error.
Please or to participate in this conversation.