Update customer/user relationships
This commit is contained in:
parent
567496e564
commit
beaa84e380
@ -55,6 +55,10 @@ class UpdateUser extends Job
|
|||||||
if ($this->request->has('companies')) {
|
if ($this->request->has('companies')) {
|
||||||
$this->user->companies()->sync($this->request->get('companies'));
|
$this->user->companies()->sync($this->request->get('companies'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->user->contact) {
|
||||||
|
$this->user->contact->update($this->request->input());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return $this->user;
|
return $this->user;
|
||||||
|
@ -38,12 +38,14 @@ class UpdateContact extends Job
|
|||||||
\DB::transaction(function () {
|
\DB::transaction(function () {
|
||||||
if ($this->request->get('create_user', 'false') === 'true') {
|
if ($this->request->get('create_user', 'false') === 'true') {
|
||||||
$this->createUser();
|
$this->createUser();
|
||||||
|
} elseif ($this->contact->user) {
|
||||||
|
$this->contact->user->update($this->request->all());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Upload logo
|
// Upload logo
|
||||||
if ($this->request->file('logo')) {
|
if ($this->request->file('logo')) {
|
||||||
$media = $this->getMedia($this->request->file('logo'), Str::plural($this->contact->type));
|
$media = $this->getMedia($this->request->file('logo'), Str::plural($this->contact->type));
|
||||||
|
|
||||||
$this->contact->attachMedia($media, 'logo');
|
$this->contact->attachMedia($media, 'logo');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user