added pointer interfaces for jobs

This commit is contained in:
Denis Duliçi
2021-09-06 11:53:57 +03:00
parent abd55133f1
commit c08a8cfc4e
63 changed files with 635 additions and 1524 deletions

View File

@ -3,31 +3,13 @@
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
class CreateWidget extends Job implements HasOwner, ShouldCreate
{
protected $widget;
protected $request;
/**
* Create a new job instance.
*
* @param $request
*/
public function __construct($request)
{
$this->request = $this->getRequestInstance($request);
$this->request->merge(['created_by' => user_id()]);
}
/**
* Execute the job.
*
* @return Widget
*/
public function handle()
public function handle(): Widget
{
$this->request['enabled'] = $this->request['enabled'] ?? 1;