CaiWuXiTong/app/Jobs/Banking/SendTransaction.php
WuYongJie 9595267ee7
Some checks failed
Tests / PHP 8.1 (push) Has been cancelled
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
chore: 导入 Akaunting 初始源码与团队协作规则
2026-07-20 18:20:25 +08:00

28 lines
757 B
PHP

<?php
namespace App\Jobs\Banking;
use App\Abstracts\Job;
use App\Events\Banking\TransactionSending;
use App\Events\Banking\TransactionSent;
use App\Models\Banking\Transaction;
use App\Notifications\Banking\Transaction as Notification;
class SendTransaction extends Job
{
public function __construct(Transaction $transaction)
{
$this->transaction = $transaction;
}
public function handle(): void
{
event(new TransactionSending($this->transaction));
// Notify the customer/vendor
$this->transaction->contact->notify(new Notification($this->transaction, config('type.transaction.' . $this->transaction->type . '.email_template'), true));
event(new TransactionSent($this->transaction));
}
}