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');
|
$dataCart = request()->input('cartResult');
|
||||||
$biodataResult = request()->input('biodataResult');
|
$biodataResult = request()->input('biodataResult');
|
||||||
$totalHarga = request()->input('totalHarga');
|
$totalHarga = request()->input('totalHarga');
|
||||||
DB::beginTransaction();
|
DB::connection('dbOrderGizi')->beginTransaction();
|
||||||
try {
|
try {
|
||||||
$jenisCustomer = $biodataResult['jenis_customer'];
|
$jenisCustomer = $biodataResult['jenis_customer'];
|
||||||
$today = now()->toDateString();
|
$today = now()->toDateString();
|
||||||
@ -308,9 +308,9 @@ class CustomerController extends Controller
|
|||||||
}
|
}
|
||||||
//code...
|
//code...
|
||||||
if($order->email){
|
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([
|
return response()->json([
|
||||||
'status' => true,
|
'status' => true,
|
||||||
'data' => $order,
|
'data' => $order,
|
||||||
@ -318,7 +318,7 @@ class CustomerController extends Controller
|
|||||||
'message' => 'Data berhasil disimpan'
|
'message' => 'Data berhasil disimpan'
|
||||||
]);
|
]);
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
DB::rollBack();
|
DB::connection('dbOrderGizi')->rollBack();
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'status' => false,
|
'status' => false,
|
||||||
'message' => 'Data gagal disimpan ' . $th->getMessage()
|
'message' => 'Data gagal disimpan ' . $th->getMessage()
|
||||||
@ -327,7 +327,7 @@ class CustomerController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function finishCheckout(){
|
public function finishCheckout(){
|
||||||
DB::beginTransaction();
|
DB::connection('dbOrderGizi')->beginTransaction();
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$noOrder = request('no_order_result');
|
$noOrder = request('no_order_result');
|
||||||
@ -366,9 +366,9 @@ class CustomerController extends Controller
|
|||||||
$order->update($payload);
|
$order->update($payload);
|
||||||
|
|
||||||
if($order->email){
|
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('payment_success', true);
|
||||||
session()->flash('no_order', $noOrder);
|
session()->flash('no_order', $noOrder);
|
||||||
return response([
|
return response([
|
||||||
@ -377,7 +377,7 @@ class CustomerController extends Controller
|
|||||||
], 200);
|
], 200);
|
||||||
return back()->with('success', 'Bukti pembayaran berhasil diunggah.');
|
return back()->with('success', 'Bukti pembayaran berhasil diunggah.');
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
DB::rollBack();
|
DB::connection('dbOrderGizi')->rollBack();
|
||||||
return response([
|
return response([
|
||||||
'status' => false,
|
'status' => false,
|
||||||
'message' => 'Gagal melakukan pesanan!'
|
'message' => 'Gagal melakukan pesanan!'
|
||||||
@ -535,7 +535,7 @@ class CustomerController extends Controller
|
|||||||
'message' => 'Pesanan Berhasil diproses'
|
'message' => 'Pesanan Berhasil diproses'
|
||||||
]);
|
]);
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
DB::rollBack();
|
DB::connection('dbOrderGizi')->rollBack();
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'status' => false,
|
'status' => false,
|
||||||
'message' => 'Pesanan gagal diproses ' . $th->getMessage()
|
'message' => 'Pesanan gagal diproses ' . $th->getMessage()
|
||||||
|
|||||||
@ -110,7 +110,7 @@ class PesananController extends Controller
|
|||||||
$order->update($payload);
|
$order->update($payload);
|
||||||
|
|
||||||
if($order->email){
|
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();
|
DB::connection('dbOrderGizi')->commit();
|
||||||
@ -147,7 +147,7 @@ class PesananController extends Controller
|
|||||||
$order->update($payload);
|
$order->update($payload);
|
||||||
|
|
||||||
if($order->email){
|
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();
|
DB::connection('dbOrderGizi')->commit();
|
||||||
return response()->json([
|
return response()->json([
|
||||||
|
|||||||
@ -16,7 +16,7 @@ return [
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'default' => env('DB_CONNECTION', 'sqlite'),
|
'default' => env('DB_CONNECTION', 'pgsql'),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|||||||
2
env_prod
2
env_prod
@ -1,5 +1,5 @@
|
|||||||
APP_NAME=Laravel
|
APP_NAME=Laravel
|
||||||
APP_ENV=local
|
APP_ENV=production
|
||||||
APP_KEY=base64:R54Pgs6qwWsP6eKZGCcHNd7rrsSSU0DsWSbFHwaT4Bc=
|
APP_KEY=base64:R54Pgs6qwWsP6eKZGCcHNd7rrsSSU0DsWSbFHwaT4Bc=
|
||||||
APP_DEBUG=true
|
APP_DEBUG=true
|
||||||
APP_URL=http://127.0.0.1:8000/
|
APP_URL=http://127.0.0.1:8000/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user