Missing job added & Code refactoring

This commit is contained in:
EnesSacid-Buker
2022-06-01 17:11:11 +03:00
committed by GitHub
parent c8a5cc1cb1
commit 6239ad7f31
3 changed files with 27 additions and 6 deletions

View File

@ -0,0 +1,27 @@
<?php
namespace App\Jobs\Common;
use App\Abstracts\Job;
use App\Models\Common\Contact;
class DuplicateContact extends Job
{
protected $clone;
public function __construct(Contact $model)
{
$this->model = $model;
parent::__construct($model);
}
public function handle(): Contact
{
\DB::transaction(function () {
$this->clone = $this->model->duplicate();
});
return $this->clone;
}
}