2021-09-04 15:35:43 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Jobs\Common;
|
|
|
|
|
|
|
|
use App\Abstracts\Job;
|
2021-09-06 11:53:57 +03:00
|
|
|
use App\Interfaces\Job\HasOwner;
|
2021-09-07 10:33:34 +03:00
|
|
|
use App\Interfaces\Job\HasSource;
|
2021-09-06 11:53:57 +03:00
|
|
|
use App\Interfaces\Job\ShouldCreate;
|
2021-09-04 15:35:43 +03:00
|
|
|
use App\Models\Common\Widget;
|
|
|
|
|
2021-09-07 10:33:34 +03:00
|
|
|
class CreateWidget extends Job implements HasOwner, HasSource, ShouldCreate
|
2021-09-04 15:35:43 +03:00
|
|
|
{
|
2021-09-06 11:53:57 +03:00
|
|
|
public function handle(): Widget
|
2021-09-04 15:35:43 +03:00
|
|
|
{
|
|
|
|
\DB::transaction(function () {
|
|
|
|
$this->widget = Widget::create($this->request->all());
|
|
|
|
});
|
|
|
|
|
|
|
|
return $this->widget;
|
|
|
|
}
|
|
|
|
}
|