68 lines
1.9 KiB
PHP
Executable File
68 lines
1.9 KiB
PHP
Executable File
<?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 App\Models\Notis;
|
|
use App\Models\NotisBid;
|
|
use App\Models\Gadai;
|
|
use App\Models\Customer;
|
|
use Illuminate\Support\Facades\Log;
|
|
use Illuminate\Support\Facades\Http;
|
|
use App\Models\CawanganNotis;
|
|
use Illuminate\Support\Facades\Artisan;
|
|
|
|
class WhatsappPemenang implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
public $user_notelbimbit;
|
|
public $total_bid_win_converted;
|
|
// protected $notisid;
|
|
// protected $cawid;
|
|
|
|
/**
|
|
* Create a new job instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct($user_notelbimbit, $total_bid_win_converted)
|
|
{
|
|
$this->user_notelbimbit = $user_notelbimbit;
|
|
$this->total_bid_win_converted = $total_bid_win_converted;
|
|
// $this->notisid = $notisid;
|
|
// $this->cawid = $cawid;
|
|
}
|
|
|
|
/**
|
|
* Execute the job.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function handle()
|
|
{
|
|
$mobile_no = ltrim($this->user_notelbimbit, '+');
|
|
$message = 'AR-RAHN PKB: Tahniah Anda Menang Bidaan Sebanyak RM' . $this->total_bid_win_converted . '. Sila Semak Melalui Sistem ArrahnBid. Terima Kasih.';
|
|
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 - menang bidaan " . $response);
|
|
}
|
|
}
|