68 lines
1.9 KiB
PHP
68 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace Modules\Lpj\Jobs;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Support\Facades\Mail;
|
|
use Modules\Lpj\Emails\SendPenawaranKJPPEmail;
|
|
|
|
class SendPenawaranKJPPTenderJob implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
protected $kjpps;
|
|
protected $dp1; // Tidak perlu array [0] lagi
|
|
protected $penawaran;
|
|
protected $permohonan;
|
|
protected $villages;
|
|
protected $districts;
|
|
protected $cities;
|
|
protected $provinces;
|
|
|
|
/**
|
|
* Create a new job instance.
|
|
*/
|
|
public function __construct($kjpps, $dp1, $penawaran, $permohonan, $villages, $districts, $cities, $provinces)
|
|
{
|
|
$this->kjpps = $kjpps;
|
|
$this->dp1 = $dp1; // Simpan keseluruhan array dp1, bukan dp1[0]
|
|
$this->penawaran = $penawaran;
|
|
$this->permohonan = $permohonan;
|
|
$this->villages = $villages;
|
|
$this->districts = $districts;
|
|
$this->cities = $cities;
|
|
$this->provinces = $provinces;
|
|
}
|
|
|
|
/**
|
|
* Execute the job.
|
|
*/
|
|
public function handle(): void
|
|
{
|
|
$email = new SendPenawaranKJPPEmail(
|
|
$this->dp1,
|
|
$this->penawaran,
|
|
$this->permohonan,
|
|
$this->villages,
|
|
$this->districts,
|
|
$this->cities,
|
|
$this->provinces
|
|
);
|
|
$email->with([
|
|
'dp1' => $this->dp1, // Kirim seluruh array dp1 ke email
|
|
'penawaran' => $this->penawaran,
|
|
'permohonan' => $this->permohonan,
|
|
'villages' => $this->villages,
|
|
'districts' => $this->districts,
|
|
'cities' => $this->cities,
|
|
'provinces' => $this->provinces,
|
|
]);
|
|
|
|
Mail::to($this->kjpps)->send($email);
|
|
}
|
|
}
|