Laravel 419 Page提交表单时已过期

时间:2020-09-25 12:47:11

标签: php html laravel laravel-5

虽然在laravel上以弹出模式提交表单时页面已过期,但我正在发送发布请求。 有人可以帮忙吗?我也添加了csrf令牌。

查看刀片服务器


<div id="reviewModal-{{$ecgparticipant->getoriginal()['id']}}" class="modal fade" role="dialog">
   <div class="modal-dialog">
      <!-- Modal content-->
      <div class="modal-content">
         <div class="modal-header" >
         </div>
         <div class="modal-body">
            <form id="ecgreviewform" class="ecgreview" action="{{ route('ecg.reviewstore') }}" method="POST">
               @csrf 
               <div class="col-md-6">
                  <div class="form-group">
                     <input type="text" class="form-control" placeholder="tesdt" id="exampleInputEmail1" aria-describedby="emailHelp" value="{{auth()->user()->name}}">
                  </div>
               </div>
                <div class="modal-footer">                                                        
                    <div class="row">
                        <div class="col-md-6">
                        <button type="button" style = "width:50%;" class="btn btn-primary btn-outline-blue btn-close-modal" data-dismiss="modal">Cancel</button>                                                
                        </div>
                        <input type="hidden" name="participant_id" value="{{$ecgparticipant->getoriginal()['id']}}">
                        <div class="col-md-6">
                        </div>
                    </div>    
                    <button type="submit" form="ecgreviewform" style = "width:50%;" name="submit" value="submit" class="btn btn-primary">Save</button>  
                </div>
            </form>
         </div>
      </div>
    </div>
</div>

路线页面

Route::get('ecg/pendingreview', 'EcgReviewController@index')->name('ecg.pendingreview');
Route::post('ecg/pendingreview', 'EcgReviewController@store')->name('ecg.reviewstore');

有什么原因

1 个答案:

答案 0 :(得分:-3)

像这样在表单中分配“方法”:

<form method="post">
@csrf <!-- {{ csrf_field() }} -->

</form> 

尝试

{{ csrf_field() }}