app/Http/Controllers/ProductController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\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)
    {
        $validated = $request->all([
            'title' => 'required',
            'quantity' => 'required',
            'price' => 'required',
            'description' => 'required',
        ]);
        $data = $request->all();
        $product->update($data);
        return redirect()->back()->with('stutus','Product update successfully');
    }
public function update ( Request $ request , Product $ product ) { $ validated = $ request -> all ( [ 'title' => 'required' , 'quantity' => 'required' , 'price' => 'required' , 'description' => 'required' , ] ) ; $ data = $ request -> all ( ) ; $ product -> update ( $ data ) ; return redirect ( ) -> back ( ) -> with ( 'stutus' , 'Product update successfully' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
//