added db transaction to jobs

This commit is contained in:
Denis Duliçi
2020-06-26 13:40:19 +03:00
parent f20f5c9def
commit acdc9da2c8
57 changed files with 606 additions and 469 deletions

View File

@ -7,6 +7,8 @@ use App\Models\Common\Report;
class CreateReport extends Job
{
protected $report;
protected $request;
/**
@ -26,8 +28,10 @@ class CreateReport extends Job
*/
public function handle()
{
$report = Report::create($this->request->all());
\DB::transaction(function () {
$this->report = Report::create($this->request->all());
});
return $report;
return $this->report;
}
}