App\Http\Controllers\Backend\CommentController::update PHP Method

update() public method

Update the specified resource in storage.
public update ( Illuminate\Http\Request $request, integer $id ) : Response
$request Illuminate\Http\Request
$id integer
return Dingo\Api\Http\Response
    public function update(Request $request, $id)
    {
        //
        $this->validate($request, ['nickname' => 'required', 'content' => 'required']);
        if (Comment::where('id', $id)->update(Input::except(['_method', '_token']))) {
            return Redirect::to('admin/comments');
        } else {
            return Redirect::back()->withInput()->withErrors('更新失败!');
        }
    }