Is card.id null or undefined?
Jul 25, 2022
4
Level 8
Ziggy error: 'project' parameter is required for route 'projects.show'
Hey Everyone,
I am using Laravel Jetstream with inertia stack for one of my projects and I am running into a strange error. so here is the scenario.
I have a Projects view which has individual projects and each project card has a link that takes you inside the project, the code is something like this
<jet-nav-link :href="route('projects.show', card.id)" class="font-medium text-cyan-700 hover:text-cyan-900"> {{ route('projects.show', card.id) }} </jet-nav-link>
When I click on the link I get the following error Ziggy error: 'project' parameter is required for route 'projects.show'
In my web.php I have
Route::get('/projects/{project}', [ProjectController::class, 'show'])->name('projects.show');
In my controller I have
public function show(Project $project)
{
//
try {
return Inertia::render('Problems/Show');
}
catch(\Exception $e)
{
}
}
What am I doing wrong?
Thank you for your time in advance!
Please or to participate in this conversation.