app/Http/Controllers/TransaksiController.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)
    {
        $update = Transaksi::find($id)->update([
            'outlet_id' =>  $request->outlet_id,
            'kode_invoice' =>  $request->kode_invoice,
            'member_id' => $request->member_id,
            'tgl' =>  $request->tgl,
            'batas_waktu' =>  $request->batas_waktu,
            'tgl_bayar' => $request->tgl_bayar,
            'biaya_tambahan' =>  $request->biaya_tambahan,
            'diskon' =>  $request->diskon,
            'pajak' => $request->pajak,
            'status' =>  $request->status,
            'dibayar' =>  $request->dibayar,
            'user_id' => $request->user_id,
            'total' => $request->total
        ]);
        if($update){
            return response()->json([
                'status' => true
            ]);
        }
        else{
            return response()->json([
                'status' => false
            ]);
        }
    }
public function update ( Request $ request , $ id ) { $ update = Transaksi :: find ( $ id ) -> update ( [ 'outlet_id' => $ request -> outlet_id , 'kode_invoice' => $ request -> kode_invoice , 'member_id' => $ request -> member_id , 'tgl' => $ request -> tgl , 'batas_waktu' => $ request -> batas_waktu , 'tgl_bayar' => $ request -> tgl_bayar , 'biaya_tambahan' => $ request -> biaya_tambahan , 'diskon' => $ request -> diskon , 'pajak' => $ request -> pajak , 'status' => $ request -> status , 'dibayar' => $ request -> dibayar , 'user_id' => $ request -> user_id , 'total' => $ request -> total ] ) ; if ( $ update ) { return response ( ) -> json ( [ 'status' => true ] ) ; } else { return response ( ) -> json ( [ 'status' => false ] ) ; } }
Update the specified resource in storage.
Update the specified resource in storage .