It seems like there might be a mismatch between the route parameters and the method parameters in your controller. The parameters are passed to the controller method in the order they are defined in the route. To fix the issue, you should ensure that the order of parameters in your controller's method signature matches the order of the route parameters.
Here's how you can correct the show method in your QuizController:
public function show($quiz_name, $index)
{
dd('quiz_name = ' . $quiz_name, 'index = ' . $index);
}
Make sure that the order of parameters in the method show($quiz_name, $index) matches the order in the route definition Route::get('/quiz/{quiz_name}/{index}', ...). This way, Laravel will inject the correct values into the correct parameters when the route is called.
If you still face issues, you might want to clear your route cache (if you're caching your routes) by running the following Artisan command:
php artisan route:clear
This will clear the route cache and ensure that any changes you've made to your routes are being recognized by the application.