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)
    {
      $data = Product::findOrFail($id);
      $data->nama = $request->nama;
      $data->harga_jual = $request->harga_jual;
      $data->harga_beli = $request->harga_beli;
      $data->disc = $request->disc;
      $data->status = $request->status;
      $data->stok = $request->stok;
      $data->keterangan = $request->keterangan;
      $data->id_unit = $request->id_unit;
      $data->id_curr = $request->id_curr;
      $data->id_kategori = $request->id_kategori;
      $data->update();
      return redirect()->route('product.index');
    }
public function update ( Request $ request , $ id ) { $ data = Product :: findOrFail ( $ id ) ; $ data -> nama = $ request -> nama ; $ data -> harga_jual = $ request -> harga_jual ; $ data -> harga_beli = $ request -> harga_beli ; $ data -> disc = $ request -> disc ; $ data -> status = $ request -> status ; $ data -> stok = $ request -> stok ; $ data -> keterangan = $ request -> keterangan ; $ data -> id_unit = $ request -> id_unit ; $ data -> id_curr = $ request -> id_curr ; $ data -> id_kategori = $ request -> id_kategori ; $ data -> update ( ) ; return redirect ( ) -> route ( 'product.index' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .