Code refactoring.
This commit is contained in:
parent
649ab36be0
commit
0f637ebda7
@ -59,10 +59,12 @@ abstract class Factory extends BaseFactory
|
|||||||
|
|
||||||
public function setCompany(): void
|
public function setCompany(): void
|
||||||
{
|
{
|
||||||
if (is_null(Cache::get('factory_company_id'))) {
|
$id = Cache::get('factory_company_id');
|
||||||
$this->company = $this->user->companies()->first();
|
|
||||||
|
if (! is_null($id)) {
|
||||||
|
$this->company = company($id);
|
||||||
} else {
|
} else {
|
||||||
$this->company = company(Cache::get('factory_company_id'));
|
$this->company = $this->user->companies()->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->company->makeCurrent();
|
$this->company->makeCurrent();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user