以下是我的刀片:
<form action="{{route('ans1.eval')}}" method="post">
<br>
<input type="radio" name="evaluate" class="evaluate" value=10> 1
<input type="radio" name="evaluate" class="evaluate" value=15> 1.5
<input type="radio" name="evaluate" class="evaluate" value=20> 2
<input type="radio" name="evaluate" class="evaluate" value=25> 2.5
<input type="radio" name="evaluate" class="evaluate" value=30> 3
<button type="submit" class="btn btn-primary" align="right">Evaluate Answer</button>
<input type="hidden" value="{{ Session::token() }}" name="_token">
</form>
以下是我的路线:
Route::post('/evaluateans', [
'uses' => 'AnswerController@postEvaluateAns',
'as' => 'ans1.eval',
'middleware' => 'auth'
]);
以下是我的验证:
public function postEvaluateAns(Request $request)
{
$this->validate($request, [
'evaluate' => 'required'
]);
}
以下是未选择评估时的错误:
MethodNotAllowedHttpException in RouteCollection.php line 218
潇潇雨雨