Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

madprabh's avatar

404 not found when using Jetstream+Inertia

Hey Folks,

So I am building this app using Jetstream+Inertia and I am running into problem when defining a route that is bound to a model:

For example, in my web.php file I have defined the following route

Route::get('/problems/{problem}',[App\Http\Controllers\ProblemController::class, 'show'])->name('problems.show');

In my vue file I have this,

<inertia-link :href="route('problems.show',{ problem: '1' })">
	<h1 id="message-heading" class="text-lg font-bold text-gray-900">
          Not having flexible data reports diminishes value of IC 10x
	</h1>
</inertia-link>

When I click on the link which actually translates to /problems/1 - it gives me 404 error

Any clues why that might be the case? Many thanks for your help.

0 likes
2 replies
devingray_'s avatar
Level 8

What does the show method on the controller look like?

something like this would work as long as you have a problem with an ID of 1

public function show(App\Models\Problem $problem)
{
   return Inertia::render('View', [
		'problem' => $problem,
  	]);
}
2 likes

Please or to participate in this conversation.