元素未更新

时间:2019-01-07 02:53:03

标签: laravel

好吧

我一直在尝试更新项目中的帖子元素。事情是我遵循了与另一件事相同的过程,但现在却无法进行……我真的不知道为什么。

这在控制器内部:

public function approve($id){
    $id = Vulnerability::where('id', $id)->first();
    $status = $id->status;
    $data['verified'] = "Approved";
    $id->update($data);
    return redirect::back();
}

status的内容没有更新...我该怎么办?我确定代码是正确的,因为我将同一块代码用于其他功能...但是...现在不起作用...

这是表格:

<form method="POST" action="/bounty/accept/{{ $id->id }}">
    <input type="hidden" name="_method" value="patch">
        {{ csrf_field() }}
            <div class="col-lg-12 col-md-6 col-sm-12 col-xs-12">
                <button class="btn btn-primary btn-lg full-width" type="submit" id="markSolved">Approve (please talk with the user by starting a thread bellow)</button>
            </div>
</form>

这是路线:

Route::patch('/bounty/accept/{id}', [

'uses' => 'BountyController@approve',

])->middleware('auth');

据我所知...是正确的...

0 个答案:

没有答案
相关问题