59 lines
1.6 KiB
PHP
59 lines
1.6 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\LogUser;
|
|
use App\Models\User;
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
|
|
|
|
class WhatsappTidakSahBayaran implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
public $user_namapembida;
|
|
|
|
/**
|
|
* Create a new job instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct($user_namapembida)
|
|
{
|
|
$this->user_namapembida = $user_namapembida;
|
|
}
|
|
|
|
/**
|
|
* Execute the job.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function handle()
|
|
{
|
|
$getnoajk = User::where('user_type', 3)->get();
|
|
foreach($getnoajk as $notifikasi){
|
|
$mobile_no = '6'.$notifikasi->notelbimbit;
|
|
|
|
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' => 'Bayaran Pembida yang bernama *'.$this->user_namapembida.'* Adalah *Tidak Sah*, Mohon Pihak AJK Lelong Untuk Buat Semakan, Terima Kasih.' ,
|
|
'instance_id' => config('app.wabot_instances_id'),
|
|
'access_token' => config('app.wabot_token_keys')
|
|
]);
|
|
}
|
|
}
|
|
}
|
|
|