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' ]);
Error message:
NotFoundHttpException in RouteCollection.php line 161 in RouteCollection.php line 161
at RouteCollection->match(object(Request)) in Router.php line 750
at Router->findRoute(object(Request)) in Router.php line 659
at Router->dispatchToRoute(object(Request)) in Router.php line 635
at Router->dispatch(object(Request)) in Kernel.php line 236
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
You are using the following route:
Which means when you submit the form, you've to pass a hidden input field named
_token
with valueput
in it, for example:I'm sure you missed it. You may check Form Method Spoofing for more information on this topic.