From ee1ca21fcc3d0c271239a8ceef107dc8cbf0cb9f Mon Sep 17 00:00:00 2001 From: Nur Izzati Zulkifli Date: Tue, 3 Jan 2023 09:32:54 +0800 Subject: [PATCH] update whatsap notifikasi masa jana pemenang --- app/Http/Controllers/LelongController.php | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/LelongController.php b/app/Http/Controllers/LelongController.php index 88d56a33..1a325e8d 100644 --- a/app/Http/Controllers/LelongController.php +++ b/app/Http/Controllers/LelongController.php @@ -2085,7 +2085,7 @@ class LelongController extends Controller $month = $current->month; $year = $current->format('y'); - $today = $current->format('Y-m-d'); + $today = $current->format('2022-12-24'); // dd($today); $lelong = Lelong::where('id', '=', $lelong_id)->first(); @@ -2173,18 +2173,7 @@ class LelongController extends Controller $invoice->total_invoice = '0.00'; $invoice->invoice_type = 2; // 1 = fee , 2 = bid $invoice->save(); - // dd($invoice->toArray()); - // dd("sni"); - //sending notify emel kepada pembida } - //send email - // Mail::to($userdetails['email'])->send(new Pemenang($userdetails['name'])); - // //send sms - // Nexmo::message()->send([ - // 'to' => $userdetails['notelbimbit'], - // 'from' => 'Sender', - // 'text' => 'ArrahnBid-Tahniah Anda Pemenang ArrahnBid, sila semak dalam pautan ini. https://bid.arrahn.com.my' - // ]); } else { $kalah = LelongBidder::where('id', '=', $bidder->id) ->first(); @@ -2206,6 +2195,17 @@ class LelongController extends Controller $userdetailsnoti = User::where('id', $noti['nopembeli'])->first(); // dd($userdetailsnoti); Mail::to($userdetailsnoti['email'])->send(new Pemenang($userdetailsnoti['name'])); + //blast whatsapp notifikasi + $mobileno = ltrim($userdetailsnoti['notelbimbit'], '+'); + $messages = 'AR-RAHN PKB: Tahniah Anda Pemenang ArrahnBid, Sila Semak Melalui Pautan ini. https://bid.arrahn.com.my'; + + $status = Http::get(env('WABOT_API'),[ + 'number' => $mobileno, + 'type' => 'text', + 'message' => $messages, + 'instance_id' => env('WABOT_INSTANCES_ID'), + 'access_token'=> env('WABOT_TOKEN_KEYS') + ]); } $lelong->sts_lelong = 3; //siap jana pemenang