add DB::connection('dbOrderGizi') di setiap controller dan ubah type pengiriman email dari method queue jadi send
This commit is contained in:
parent
23832a46bb
commit
eaecf8932c
@ -260,7 +260,7 @@ class CustomerController extends Controller
|
||||
$dataCart = request()->input('cartResult');
|
||||
$biodataResult = request()->input('biodataResult');
|
||||
$totalHarga = request()->input('totalHarga');
|
||||
DB::beginTransaction();
|
||||
DB::connection('dbOrderGizi')->beginTransaction();
|
||||
try {
|
||||
$jenisCustomer = $biodataResult['jenis_customer'];
|
||||
$today = now()->toDateString();
|
||||
@ -308,9 +308,9 @@ class CustomerController extends Controller
|
||||
}
|
||||
//code...
|
||||
if($order->email){
|
||||
Mail::to($order->email)->queue(new NotifikasiCustomer($order->nama_pemesan, $order->no_order, $order->total_harga));
|
||||
Mail::to($order->email)->send(new NotifikasiCustomer($order->nama_pemesan, $order->no_order, $order->total_harga));
|
||||
}
|
||||
DB::commit();
|
||||
DB::connection('dbOrderGizi')->commit();
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'data' => $order,
|
||||
@ -318,7 +318,7 @@ class CustomerController extends Controller
|
||||
'message' => 'Data berhasil disimpan'
|
||||
]);
|
||||
} catch (\Throwable $th) {
|
||||
DB::rollBack();
|
||||
DB::connection('dbOrderGizi')->rollBack();
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'message' => 'Data gagal disimpan ' . $th->getMessage()
|
||||
@ -327,7 +327,7 @@ class CustomerController extends Controller
|
||||
}
|
||||
|
||||
public function finishCheckout(){
|
||||
DB::beginTransaction();
|
||||
DB::connection('dbOrderGizi')->beginTransaction();
|
||||
try {
|
||||
|
||||
$noOrder = request('no_order_result');
|
||||
@ -366,9 +366,9 @@ class CustomerController extends Controller
|
||||
$order->update($payload);
|
||||
|
||||
if($order->email){
|
||||
Mail::to($order->email)->queue(new NotifikasiPembayaran($order->nama_pemesan, $order->no_order));
|
||||
Mail::to($order->email)->send(new NotifikasiPembayaran($order->nama_pemesan, $order->no_order));
|
||||
}
|
||||
DB::commit();
|
||||
DB::connection('dbOrderGizi')->commit();
|
||||
session()->flash('payment_success', true);
|
||||
session()->flash('no_order', $noOrder);
|
||||
return response([
|
||||
@ -377,7 +377,7 @@ class CustomerController extends Controller
|
||||
], 200);
|
||||
return back()->with('success', 'Bukti pembayaran berhasil diunggah.');
|
||||
} catch (\Throwable $th) {
|
||||
DB::rollBack();
|
||||
DB::connection('dbOrderGizi')->rollBack();
|
||||
return response([
|
||||
'status' => false,
|
||||
'message' => 'Gagal melakukan pesanan!'
|
||||
@ -535,7 +535,7 @@ class CustomerController extends Controller
|
||||
'message' => 'Pesanan Berhasil diproses'
|
||||
]);
|
||||
} catch (\Throwable $th) {
|
||||
DB::rollBack();
|
||||
DB::connection('dbOrderGizi')->rollBack();
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'message' => 'Pesanan gagal diproses ' . $th->getMessage()
|
||||
|
||||
@ -110,7 +110,7 @@ class PesananController extends Controller
|
||||
$order->update($payload);
|
||||
|
||||
if($order->email){
|
||||
Mail::to($order->email)->queue(new NotifikasiKonfirmasiPembayaran($order->nama_pemesan, $order->no_order, $order->total_harga));
|
||||
Mail::to($order->email)->send(new NotifikasiKonfirmasiPembayaran($order->nama_pemesan, $order->no_order, $order->total_harga));
|
||||
}
|
||||
|
||||
DB::connection('dbOrderGizi')->commit();
|
||||
@ -147,7 +147,7 @@ class PesananController extends Controller
|
||||
$order->update($payload);
|
||||
|
||||
if($order->email){
|
||||
Mail::to($order->email)->queue(new NotifikasiKonfirmasiPembayaran($order->nama_pemesan, $order->no_order, $order->total_harga));
|
||||
Mail::to($order->email)->send(new NotifikasiKonfirmasiPembayaran($order->nama_pemesan, $order->no_order, $order->total_harga));
|
||||
}
|
||||
DB::connection('dbOrderGizi')->commit();
|
||||
return response()->json([
|
||||
|
||||
@ -16,7 +16,7 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('DB_CONNECTION', 'sqlite'),
|
||||
'default' => env('DB_CONNECTION', 'pgsql'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user