首页 > 解决方案 > 拉拉维尔 5.3。某些词在发布时导致方法未找到异常

问题描述

method not found exception我在尝试将这句话发布到控制器时遇到了 laravel

5-6。___ 青霉素是一种用于各种感染的____,是在实验室培养皿中长出一些霉菌后偶然发现的。

我尝试删除句子的一部分,发现只要包含“青霉素”这个词,就会出现错误。

什么可能导致这个问题?

这是我的表格代码。我在 laravel 5.3 中使用 tinymce 插件

<form class="form-horizontal" role="form" method="POST" action="{{url('question/essay/insert') }}">
        {{ csrf_field() }}
        <div class="row">

          <div class="col-xs-12 col-md-12">

              <div class="{{ $errors->has('question') ? ' has-error' : '' }}">
                  <label for="question" class="control-label">Question</label>
                  <textarea maxlength="50000" rows="10" id="question" type="text-area" class="form-control" name="question" value="{{ old('question') }}" required autofocus> {{ old('question') }} </textarea>

                  @if ($errors->has('question'))
                     <span class="help-block">
                       <strong>{{ $errors->first('question') }}</strong>
                     </span>
                  @endif

            </div>
            <div class="spacer-s"></div>
          </div>
       </div>

       <div class="row">
           <div class="col-xs-12 col-md-12">
             <div class="action-wrapper">
                <button type="submit" class="btn btn-primary">Add</button>
             </div>
           </div>
       </div>
</form>

我的路由代码

Route::post('question/essay/insert','QuestionsController@insertEssayQuestion')->middleware('auth');

标签: phplaravellaravel-5

解决方案


如果您发布更新路线,您需要在表单中添加 _method 输入。

@method('put')

推荐阅读