app/Http/Controllers/Transaksi.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 = ModelTransaksi::where('id',$id)->first();
         $data->tanggal = $request->tanggal;
         $data->keterangan = $request->keterangan;
         $data->kategori_id = $request->id;
         $data->subkategori_id = $request->namasub;
         $data->jenis_transaksi = $request->trans;
         $data->jumlah = $request->jumlah;
         $data->save();
         return redirect()->route('transaksi.index')->with('alert-success','Data berhasil diubah!');
    }
public function update ( Request $ request , $ id ) { $ data = ModelTransaksi :: where ( 'id' , $ id ) -> first ( ) ; $ data -> tanggal = $ request -> tanggal ; $ data -> keterangan = $ request -> keterangan ; $ data -> kategori_id = $ request -> id ; $ data -> subkategori_id = $ request -> namasub ; $ data -> jenis_transaksi = $ request -> trans ; $ data -> jumlah = $ request -> jumlah ; $ data -> save ( ) ; return redirect ( ) -> route ( 'transaksi.index' ) -> with ( 'alert-success' , 'Data berhasil diubah!' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .