app/Http/Controllers/ProductController.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)
    {
            Product::where('id', $id)->update([
            'name'=>$request->input('name'),
            'slug'=>$request->input('slug'),
            'description'=>$request->input('description'),
            'price'=>$request->input('price')
        ]);
        return Product::all();
    }
public function update ( Request $ request , $ id ) { Product :: where ( 'id' , $ id ) -> update ( [ 'name' => $ request -> input ( 'name' ) , 'slug' => $ request -> input ( 'slug' ) , 'description' => $ request -> input ( 'description' ) , 'price' => $ request -> input ( 'price' ) ] ) ; return Product :: all ( ) ; }
Update the specified resource in storage.
Update the specified resource in storage .