/**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(TaxRequest $request, $id)
 {
     if (Tax::find($id)->update($request->all())) {
         return redirect('/tax')->with('succcess', 'Sukses ubah data pajak pelanggan.');
     }
     return redirect()->back()->withErrors(['failed' => 'Gagal ubah data pajak pelanggan.']);
 }
예제 #2
0
 /**
  * Update the specified resource in storage.
  *
  * @param TaxRequest $request
  * @param  int $id
  * @return Response
  */
 public function update(TaxRequest $request, $id)
 {
     $tid = SysTax::find($id);
     SysLog::create(['type' => 'Admin', 'date' => Carbon::now(), 'userid' => Auth::user()->id, 'ip' => $request->ip(), 'description' => 'Tax Rate edited: ' . $tid->name . ' [ TxID : ' . $tid->id . ' | ' . ' Old Rate : ' . $tid->rate . ' -> ' . ' New Rate : ' . $request->rate . ' ]']);
     $tid->update($request->all());
     return redirect()->route('tax.index')->withMessage('Tax has been Updated')->withStatus('success');
 }