55 lines
1.7 KiB
PHP
55 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use App\Barang;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Http\Request;
|
|
|
|
class DrugRestriction extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
protected $barang;
|
|
protected $request;
|
|
/**
|
|
* Create a new message instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct(Barang $barang,Request $request)
|
|
{
|
|
$this->barang = $barang;
|
|
$this->request = $request;
|
|
}
|
|
|
|
/**
|
|
* Build the message.
|
|
*
|
|
* @return $this
|
|
*/
|
|
public function build()
|
|
{
|
|
$config = config('beautymail.view');
|
|
if(array_key_exists('logo',$config)){
|
|
$config['logo']['path'] = preg_replace("/\%PUBLIC\%/",env('APP_URL'),$config['logo']['path']);
|
|
}
|
|
// dd($this->barang);
|
|
return $this->view('emails.drugnotif')
|
|
->with(array_merge($config,[
|
|
'namapasien' => $this->request->input('nama_pasien'),
|
|
'usia' => $this->request->input('usia'),
|
|
'diagnosa' => $this->request->input('diagnosa'),
|
|
'namaObat' => $this->barang->Nama,
|
|
'signa' => $this->request->input('signa'),
|
|
'jumlah_obat' => $this->request->input('jumlah_obat'),
|
|
'kode_kirim' => $this->request->input('kode'),
|
|
'senderName' => env('MAIL_FROM_NAME','SIMRS')
|
|
]))
|
|
->subject('Ijin Penggunaan Obat '.$this->barang->Nama.' '.$this->request->input('nomr'));
|
|
}
|
|
}
|