nokp = $nokp; $this->telefon = $telefon; $this->caw_name = $caw_name; $this->nofoncaw = $nofoncaw; $this->kodcaw = $kodcaw; $this->norujukan = $norujukan; $this->tempoh = $tempoh; $this->tmatang = $tmatang; $this->tmatang1 = $tmatang1; $this->lelong_tawarruq = $lelong_tawarruq; } /** * Execute the job. * * @return void */ public function handle() { $current = Carbon::now(); $current = new Carbon(); $mobile_no = ltrim($this->telefon, '+6'); // $mobile_no = '60178916936'; $tarikhmatang = $this->tmatang; $tarikhmatangnew = date('d-m-Y',strtotime($tarikhmatang)); $tarikhmatang1 = $this->tmatang1; $tarikhmatang1new = date('d-m-Y',strtotime($tarikhmatang1)); $today = $current->toDateString(); if($this->lelong_tawarruq == '1'){ if($tarikhmatang > $today){ $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah hampir tamat tempoh matang, Sila buat pembayaran di cawangan sebelum *'.$tarikhmatangnew.'*.'; }elseif($tarikhmatang < $today){ $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah tamat tempoh matang pada *'.$tarikhmatangnew.'*, Sila buat pembayaran di cawangan AR-RAHN.';} }else if($tarikhmatang1 < $today){ $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah hampir tamat tempoh kontrak, Sila buat pembayaran di cawangan sebelum *'.$tarikhmatang1new.'*.'; }elseif($tarikhmatang1 > $today){ $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah tamat tempoh kontrak pada *'.$tarikhmatang1new.'*, Sila buat pembayaran di cawangan Ar-Rahn.';} if(env('APP_ENV') != 'production'){ $mobile_no = env('ADMIN_PHONE_NUMBER'); } $response = Http::get(env('WABOT_API'), [ 'number' => $mobile_no, 'type' => 'text', 'message' => $message, 'instance_id' => env('WABOT_INSTANCES_ID'), 'access_token' => env('WABOT_TOKEN_KEYS') ]); //insert log blast wasap $logblastwasap = new BlastWasap(); $logblastwasap->kodcaw = $this->kodcaw; $logblastwasap->nokp = $this->nokp; $logblastwasap->notelefon = $this->telefon; $logblastwasap->norujukan = $this->norujukan; $logblastwasap->tempoh = $this->tempoh; $logblastwasap->status = $response; $logblastwasap->created_at = $current; $logblastwasap->updated_at = $current; $logblastwasap->save(); Log::info("WABOT - Pelanggan SAG Tawarruq Lama".$response); } }