app/Http/Controllers/BarangController.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)
    {
        Barang::find($id)->update(['id_lab'=>$request->id_lab]);
        Barang::find($id)->update(['nama_barang'=>$request->nama_barang]);
        Barang::find($id)->update(['harga'=>$request->harga]);
        return redirect()->route('barang.index');
    }
public function update ( Request $ request , $ id ) { Barang :: find ( $ id ) -> update ( [ 'id_lab' => $ request -> id_lab ] ) ; Barang :: find ( $ id ) -> update ( [ 'nama_barang' => $ request -> nama_barang ] ) ; Barang :: find ( $ id ) -> update ( [ 'harga' => $ request -> harga ] ) ; return redirect ( ) -> route ( 'barang.index' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .