CaiWuXiTong/app/Jobs/Common/UpdateReport.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

27 lines
643 B
PHP

<?php
namespace App\Jobs\Common;
use App\Abstracts\Job;
use App\Interfaces\Job\ShouldUpdate;
use App\Models\Common\Report;
class UpdateReport extends Job implements ShouldUpdate
{
public function handle(): Report
{
// Security: strip HTML tags from description to prevent stored XSS.
if ($this->request->has('description')) {
$this->request->merge([
'description' => strip_tags($this->request->get('description')),
]);
}
\DB::transaction(function () {
$this->model->update($this->request->all());
});
return $this->model;
}
}