64 lines
1.9 KiB
PHP
64 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Jobs;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
use App\Models\Cawangan;
|
|
use Carbon\Carbon;
|
|
use Illuminate\Support\Facades\Log;
|
|
use Illuminate\Support\Facades\Http;
|
|
use Illuminate\Support\Facades\Artisan;
|
|
|
|
class WhatsappPengesahanPembida implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
public $user_notelbimbit;
|
|
public $user_namapembida;
|
|
public $user_cawname;
|
|
|
|
// protected $notisid;
|
|
// protected $cawid;
|
|
|
|
/**
|
|
* Create a new job instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct($user_notelbimbit,$user_namapembida,$user_cawname)
|
|
{
|
|
$this->user_notelbimbit = $user_notelbimbit;
|
|
$this->user_namapembida = $user_namapembida;
|
|
$this->user_cawname = $user_cawname;
|
|
}
|
|
|
|
/**
|
|
* Execute the job.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function handle()
|
|
{
|
|
$mobile_no = ltrim($this->user_notelbimbit, '+');
|
|
$message = 'AR-RAHN PKB: Terima Kasih '.$this->user_namapembida .', Pembayaran Bidaan Anda Untuk Cawangan *'.$this->user_cawname.'* Telah Disahkan, Sila Ke Cawangan Berkenaan Untuk Tuntutan Barang Bidaan Anda Hari Ini.';
|
|
if(config('app.env') != 'production'){
|
|
$mobile_no = config('app.admin_phone_number');
|
|
}
|
|
$response = Http::get(config('app.wabot_api'), [
|
|
'number' => $mobile_no,
|
|
'type' => 'text',
|
|
'message' => $message,
|
|
'instance_id' => config('app.wabot_instances_id'),
|
|
'access_token' => config('app.wabot_token_keys')
|
|
]);
|
|
|
|
Log::info("WABOT - Akaun Telah Sahkan Pembayaran: ".$this->user_namapembida .'' . $response);
|
|
}
|
|
}
|