app/Http/Controllers/ProductController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Model\Product  $product
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, Product $product)
    {
        $this->CheckProductOwner($product);
        if($request->description !== null){
            $request['details'] = $request->description;
            unset($request['description']);
        }
        $product->update($request->all());
        return response([
            'data' => new ProductResource($product)
        ],Response::HTTP_OK);
    }
public function update ( Request $ request , Product $ product ) { $ this -> CheckProductOwner ( $ product ) ; if ( $ request -> description !== null ) { $ request [ 'details' ] = $ request -> description ; unset ( $ request [ 'description' ] ) ; } $ product -> update ( $ request -> all ( ) ) ; return response ( [ 'data' => new ProductResource ( $ product ) ] , Response :: HTTP_OK ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
//