app/Http/Controllers/PhieuNhapHangController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function updatePnh(Request $request)
    {
        if($request->id && $request->quantity)
        {
            $pnh = session()->get('pnh');
            $pnh[$request->id]["quantity"] = $request->quantity;
            $pnh[$request->id]["price"] = $request->price;
            $pnh[$request->id]["total"] = $request->price*$request->quantity;
            session()->put('pnh', $pnh);
            session()->flash('success', 'Cập nhật thành công');
        }
    }
public function updatePnh ( Request $ request ) { if ( $ request -> id && $ request -> quantity ) { $ pnh = session ( ) -> get ( 'pnh' ) ; $ pnh [ $ request -> id ] [ " quantity " ] = $ request -> quantity ; $ pnh [ $ request -> id ] [ " price " ] = $ request -> price ; $ pnh [ $ request -> id ] [ " total " ] = $ request -> price * $ request -> quantity ; session ( ) -> put ( 'pnh' , $ pnh ) ; session ( ) -> flash ( 'success' , 'Cập nhật thành công'); } }
Update the specified resource in storage.
Update the specified resource in storage .