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                = Product::find($id);
      $product->name          = $request->name;
      $product->category      = $request->category;
      $product->price         = $request->price;
      $product->product_image = $fileName;
      $product->save();
      return redirect('admin/product' . $id);
    }
public function update ( Request $ request , $ id ) { $ product = Product :: find ( $ id ) ; $ product -> name = $ request -> name ; $ product -> category = $ request -> category ; $ product -> price = $ request -> price ; $ product -> product_image = $ fileName ; $ product -> save ( ) ; return redirect ( 'admin/product' . $ id ) ; }
Update the specified resource in storage.
Update the specified resource in storage .