Why are you getting the CarClass model twice ?
public function show(CarClass $carClass)
{
$resp = new CarResource($carClass);
return Inertia::render('Cars/Show', ['car' => $resp]);
}
Remove this
public function getRouteKey() //only needed if you want it to always use slug
{
return $this->slug;
}
or fix it
public function getRouteKey()
{
return 'slug';
}