Update customer/user relationships

This commit is contained in:
Burak Çakırel
2021-04-29 11:43:52 +03:00
parent 567496e564
commit beaa84e380
2 changed files with 7 additions and 1 deletions

View File

@ -38,12 +38,14 @@ class UpdateContact extends Job
\DB::transaction(function () {
if ($this->request->get('create_user', 'false') === 'true') {
$this->createUser();
} elseif ($this->contact->user) {
$this->contact->user->update($this->request->all());
}
// Upload logo
if ($this->request->file('logo')) {
$media = $this->getMedia($this->request->file('logo'), Str::plural($this->contact->type));
$this->contact->attachMedia($media, 'logo');
}