Company created event changes..

This commit is contained in:
Cüneyt Şentürk 2022-10-25 10:15:07 +03:00
parent 34383d60e7
commit 5eace1cbd0
2 changed files with 7 additions and 4 deletions

View File

@ -8,13 +8,16 @@ class CompanyCreated extends Event
{ {
public $company; public $company;
public $request;
/** /**
* Create a new event instance. * Create a new event instance.
* *
* @param $company * @param $company
*/ */
public function __construct($company) public function __construct($company, $request = null)
{ {
$this->company = $company; $this->company = $company;
$this->request = $request;
} }
} }

View File

@ -29,12 +29,12 @@ class CreateCompany extends Job implements HasOwner, HasSource, ShouldCreate
$this->updateSettings(); $this->updateSettings();
}); });
event(new CompanyCreated($this->model));
if (! empty($current_company_id)) { if (! empty($current_company_id)) {
company($current_company_id)->makeCurrent(); company($current_company_id)->makeCurrent();
} }
event(new CompanyCreated($this->model, $this->request));
return $this->model; return $this->model;
} }