akaunting/app/Jobs/Common/CreateWidget.php
2021-09-06 14:46:42 +03:00

21 lines
426 B
PHP

<?php
namespace App\Jobs\Common;
use App\Abstracts\Job;
use App\Interfaces\Job\HasOwner;
use App\Interfaces\Job\ShouldCreate;
use App\Models\Common\Widget;
class CreateWidget extends Job implements HasOwner, ShouldCreate
{
public function handle(): Widget
{
\DB::transaction(function () {
$this->widget = Widget::create($this->request->all());
});
return $this->widget;
}
}