Ad
Laravel 5.1 NotFoundHttpException In RouteCollection.php Line 161:
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' => '[email protected]' ]);
Route::get('quiz/token/{quizByToken}', [ 'as' => 'quiz.token', 'uses' => '[email protected]' ]);
Route::get('quiz/code/{quizByCode}', [ 'as' => 'quiz.code', 'uses' => '[email protected]' ]);
Route::get('quiz/id/{quiz}/players', [ 'as' => 'quiz.players', 'uses' => '[email protected]' ]);
Route::get('quiz/token/{quizByToken}/players/highscore', [ 'as' => 'quizzes.player.highscore', 'uses' => '[email protected]' ]);
Route::put('quiz/nextQuestion/{quizByToken}', [ 'as' => 'quizzes.nextQuestion', 'uses' => '[email protected]' ]);
Route::get('quiz/poll/{quiz}', [ 'as' => 'quizzes.poll', 'uses' => '[email protected]' ]);
Route::put('quiz/poll/token/{quizByToken}/delay-current/{delayTime}', [ 'as' => 'quizzes.delayTime', 'uses' => '[email protected]' ]);
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
Ad
Answer
You are using the following route:
Route::put(
'quiz/poll/token/{quizByToken}/delay-current/{delayTime}',
[ 'as' => 'quizzes.delayTime', 'uses' => '[email protected]'
]);
Which means when you submit the form, you've to pass a hidden input field named _token
with value put
in it, for example:
<form method='POST'>
<input type="hidden" name="_method" value="PUT" />
<!-- Other Fields -->
</form>
I'm sure you missed it. You may check Form Method Spoofing for more information on this topic.
Ad
source: stackoverflow.com
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS - Conditionally Load a Different Page
- → Make a Laravel collection into angular array (octobercms)
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
- → Validating fileupload(image Dimensions) in Backend Octobercms
- → OctoberCMS Fileupload completely destroys my backend
- → How do I call the value from another backed page form and use it on a component in OctoberCms
Ad