我正在制作一個(gè)新的報(bào)告系統(tǒng),我剛開(kāi)始,設(shè)計(jì)已經(jīng)完成,但是當(dāng)我按下提交時(shí),數(shù)據(jù)庫(kù)中沒(méi)有發(fā)生任何事情,我得到0條記錄。我的代碼有什么問(wèn)題?或者我需要添加更多內(nèi)容?我的觀點(diǎn):<!-- 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">×</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>
2 回答

阿晨1998
TA貢獻(xiàn)2037條經(jīng)驗(yàn) 獲得超6個(gè)贊
在 Form 標(biāo)簽內(nèi)添加您的表單提交目的地和提交類型。目前表單標(biāo)簽內(nèi)沒(méi)有任何內(nèi)容。并且不要忘記在表單中添加 csrf 字段。
例子:
<form role="form" action="{{ action('CareerSolutionController@careerReport') }}" method="post">
{!! csrf_field() !!}
或者
<form role="form" action="{{ url('career_report') }}" method="post">
{!! csrf_field() !!}

搖曳的薔薇
TA貢獻(xiàn)1793條經(jīng)驗(yàn) 獲得超6個(gè)贊
我看到了問(wèn)題,您從未在刀片中定義表單操作,因此表單不知道該做什么。將您的表單打開(kāi)更改為:
<form role="form" action="{{ action('CareerSolutionController@careerReport') }}>
并且不要忘記在其下方添加 crsf 令牌:
@csrf
或者為方便起見(jiàn),為您的路線添加自定義名稱:
Route::post('career_report', 'CareerSolutionController@careerReport')->as('career.report');
并像這樣以您的形式使用它:
<form role="form" action="{{ route('career.report') }}" method=POST>
- 2 回答
- 0 關(guān)注
- 153 瀏覽
添加回答
舉報(bào)
0/150
提交
取消