app/Http/Controllers/Admin/CateController.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)
    {
       $post = $request->except('_token');
       $res = DB::table('category')->where('cate_id',$id)->update($post);
       if($res!==false){
        return redirect('/cate');
       }
    }
public function update ( Request $ request , $ id ) { $ post = $ request -> except ( '_token' ) ; $ res = DB :: table ( 'category' ) -> where ( 'cate_id' , $ id ) -> update ( $ post ) ; if ( $ res !== false ) { return redirect ( '/cate' ) ; } }
Update the specified resource in storage.
Update the specified resource in storage .
// //orm操作 // $cate = Category::find($id); // $catelist->cate_name = $post['cate_name']; // $catelist->parent_id = $post['parent_id']; // $catelist->is_show = $post['is_show']; // $catelist->is_nav_show = $post['is_nav_show']; // $res = $catelist->save(); // //dd($res); // if($res!==false){ //     return redirect('/cate'); // }