猿问

根据我的报告,我的表单未保存在数据库中

我正在制作一个新的报告系统,我刚开始,设计已经完成,但是当我按下提交时,数据库中没有发生任何事情,我得到0条记录。我的代码有什么问题?或者我需要添加更多内容?


我的观点:


<!-- Modal -->

<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">

  <div class="modal-dialog" role="document">

    <div class="modal-content" style="top: 50px">

      <div class="modal-header" style="border-bottom: none">

        <button type="button" class="close" data-dismiss="modal" aria-label="Close">

          <span aria-hidden="true">&times;</span>

        </button>

      </div>

      <div class="modal-body">

        <div class="container">

    <div class="row">

        <section>

        <div class="wizard col-md-6" style="right: 5px;margin: 0px auto">

            <div class="wizard-inner">

                <div class="connecting-line"></div>

                <ul class="nav nav-tabs" role="tablist" style="margin: 0px auto">


                    <li role="presentation" class="active">

                        <a href="#step1" data-toggle="tab" aria-controls="step1" role="tab" title="Step 1">

                            <span class="round-tab">

                                <i class="icon-pencil"></i>

                            </span>

                        </a>

                    </li>


                    <li role="presentation" class="disabled">

                        <a href="#step2" data-toggle="tab" aria-controls="step2" role="tab" title="Step 2">

                            <span class="round-tab">

                                <i class="icon-note"></i>

                            </span>

                        </a>


慕哥6287543
浏览 161回答 2
2回答

阿晨1998

在 Form 标签内添加您的表单提交目的地和提交类型。目前表单标签内没有任何内容。并且不要忘记在表单中添加 csrf 字段。例子:<form role="form" action="{{ action('CareerSolutionController@careerReport') }}" method="post">{!! csrf_field() !!}或者<form role="form" action="{{ url('career_report') }}" method="post">{!! csrf_field() !!}

摇曳的蔷薇

我看到了问题,您从未在刀片中定义表单操作,因此表单不知道该做什么。将您的表单打开更改为:<form&nbsp;role="form"&nbsp;action="{{&nbsp;action('CareerSolutionController@careerReport')&nbsp;}}>并且不要忘记在其下方添加 crsf 令牌:@csrf或者为方便起见,为您的路线添加自定义名称:Route::post('career_report',&nbsp;'CareerSolutionController@careerReport')->as('career.report');并像这样以您的形式使用它:<form&nbsp;role="form"&nbsp;action="{{&nbsp;route('career.report')&nbsp;}}"&nbsp;method=POST>
随时随地看视频慕课网APP
我要回答