fixed installation user assign company..
This commit is contained in:
parent
1b4fb495db
commit
93a23d9399
@ -52,6 +52,7 @@ class CreateUser extends Job
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->request->has('companies')) {
|
if ($this->request->has('companies')) {
|
||||||
|
if (request()->isNotInstall()) {
|
||||||
$user = user();
|
$user = user();
|
||||||
|
|
||||||
$companies = $user->withoutEvents(function () use ($user) {
|
$companies = $user->withoutEvents(function () use ($user) {
|
||||||
@ -61,6 +62,9 @@ class CreateUser extends Job
|
|||||||
if ($companies->isNotEmpty()) {
|
if ($companies->isNotEmpty()) {
|
||||||
$this->user->companies()->attach($companies->toArray());
|
$this->user->companies()->attach($companies->toArray());
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$this->user->companies()->attach($this->request->get('companies'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->user->companies)) {
|
if (empty($this->user->companies)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user