error handling update pembayaran

parent 3e0d0d9d
...@@ -342,21 +342,29 @@ public function updatePembayaran(Request $request, $va) ...@@ -342,21 +342,29 @@ public function updatePembayaran(Request $request, $va)
], 200); ], 200);
} }
$registrasi = Registrasi::query() try{
->with('pkKegiatan', 'pkRegistrasiPeserta.rKegiatanPeserta', 'pkRegistrasiPeserta.rKonferensiPeserta') $registrasi = Registrasi::query()
->where('nomor_va', $va) ->with('pkKegiatan', 'pkRegistrasiPeserta.rKegiatanPeserta', 'pkRegistrasiPeserta.rKonferensiPeserta')
->update([ ->where('nomor_va', $va)
'tanggal_bayar' => Carbon::now() ->update([
]); 'tanggal_bayar' => Carbon::now()
]);
$data = $this->getDataRegis($va); $data = $this->getDataRegis($va);
SendMail::dispatch($data, 'email.selesai_pembayaran', $data['registrasi']->email, 'registrasi', 'email_pembayaran_sent_at'); SendMail::dispatch($data, 'email.selesai_pembayaran', $data['registrasi']->email, 'registrasi', 'email_pembayaran_sent_at');
return response([ return response([
'status' => 200, 'status' => 200,
'message' => 'success' 'message' => 'success'
], 200); ], 200);
}
catch(Exception $ex){
return response([
'status' => 404,
'message' => 'gagal mengupdate data'
], 200);
}
} }
public function testEmail(Request $request) public function testEmail(Request $request)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment