Add company create and update events
This commit is contained in:
@ -3,6 +3,8 @@
|
||||
namespace App\Jobs\Common;
|
||||
|
||||
use App\Abstracts\Job;
|
||||
use App\Events\Common\CompanyUpdated;
|
||||
use App\Events\Common\CompanyUpdating;
|
||||
use App\Models\Common\Company;
|
||||
use App\Traits\Users;
|
||||
|
||||
@ -35,6 +37,8 @@ class UpdateCompany extends Job
|
||||
{
|
||||
$this->authorize();
|
||||
|
||||
event(new CompanyUpdating($this->company, $this->request));
|
||||
|
||||
\DB::transaction(function () {
|
||||
$this->company->update($this->request->all());
|
||||
|
||||
@ -77,6 +81,8 @@ class UpdateCompany extends Job
|
||||
setting()->forgetAll();
|
||||
});
|
||||
|
||||
event(new CompanyUpdated($this->company, $this->request));
|
||||
|
||||
return $this->company;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user