app/Http/Controllers/admin/SlidsController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, $id)
    {
        $data = $request -> except(['_token']);
        dump($request -> except(['_token']));
         存储信息
        $slids = Slids::find($id);
        $slids -> surl = $data['surl'];
        $slids -> state = $data['state'];
        $res = $slids -> save();
        处理返回值
        if($res){
            return redirect(url('admin/slids')) -> with('success','修改成功');
        }else{
            return back() -> with('error','修改失败');
        }
    }
public function update ( Request $ request , $ id ) { $ data = $ request -> except ( [ '_token' ] ) ; $ slids = Slids :: find ( $ id ) ; $ slids -> surl = $ data [ 'surl' ] ; $ slids -> state = $ data [ 'state' ] ; $ res = $ slids -> save ( ) ; if ( $ res ) { return redirect ( url ( 'admin/slids' ) ) -> with ( 'success' , '修改成功'); } else { return back ( ) -> with ( 'error' , '修改失败'); } }
Update the specified resource in storage.
Update the specified resource in storage .
// //dump($request -> except(['_token'])); //存储信息 //处理返回值