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

Leff7's avatar

Routing -NotFoundHttpException in RouteCollection.php line 161:

Hi,

I get this error when I try to access delayTime method. I can't see what I am doing wrong. I have the routes setup like this:

   Route::post('quiz', [ 'as' => 'quiz', 'uses' => 'QuizController@create' ]);
   Route::get('quiz/token/{quizByToken}', [ 'as' => 'quiz.token', 'uses' => 'QuizController@getQuizByToken' ]);
   Route::get('quiz/code/{quizByCode}', [ 'as' => 'quiz.code', 'uses' => 'QuizController@getQuizByCode' ]);
   Route::get('quiz/id/{quiz}/players', [ 'as' => 'quiz.players', 'uses' => 'QuizController@getQuizPlayers' ]);
   Route::get('quiz/token/{quizByToken}/players/highscore', [ 'as' => 'quizzes.player.highscore', 'uses' =>    'PlayerController@highscore' ]);
   Route::put('quiz/nextQuestion/{quizByToken}', [ 'as' => 'quizzes.nextQuestion', 'uses' => 'QuizController@nextQuestion' ]);
   Route::get('quiz/poll/{quiz}', [ 'as' => 'quizzes.poll', 'uses' => 'QuizController@currentQuestion' ]);
   Route::put('quiz/poll/token/{quizByToken}/delay-current/{delayTime}', [ 'as' => 'quizzes.delayTime', 'uses' => 'QuizController@delayTime' ]);
0 likes
4 replies
ricardovigatti's avatar

This is the normal 404 NotFoundHttpException for routes. Have to check if you are trying to access this using the right way.

  1. Check if you is really using PUT when accessing this URL.
  2. Check for typo errors at the code you are using to reach this URL.
  3. Check for typo errors at your QuizController

I've copied and pasted this on my application and it's working normally.

mstnorris's avatar
  1. What is the actual URL that you're accessing denoted by the route quiz/poll/token/{quizByToken}/delay-current/{delayTime}
  2. Is it a PUT request? Or a GET request?
Leff7's avatar

I was passing the parameter in a wrong way, stupid mistake, thank you anyway!

Please or to participate in this conversation.