Skip to content

Commit

Permalink
fixed create document company logo issue
Browse files Browse the repository at this point in the history
  • Loading branch information
CihanSenturk committed Oct 18, 2023
1 parent 3c582c7 commit ab5a55f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/Listeners/Document/SettingFieldCreated.php
Expand Up @@ -61,6 +61,8 @@ public function handle(Event $event)
// Upload attachment
$media = $this->getMedia($value, 'settings');

$real_key = $this->getDocumentSettingKey($type, $key);

$company->attachMedia($media, Str::snake($real_key));

$value = $media->id;
Expand All @@ -71,8 +73,6 @@ public function handle(Event $event)
continue;
}

$real_key = setting($this->getDocumentSettingKey($type, $key));

setting()->set($real_key, $value);
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/Listeners/Document/SettingFieldUpdated.php
Expand Up @@ -61,6 +61,8 @@ public function handle(Event $event)
// Upload attachment
$media = $this->getMedia($value, 'settings');

$real_key = $type . '.' . $key;

$company->attachMedia($media, Str::snake($real_key));

$value = $media->id;
Expand All @@ -71,8 +73,6 @@ public function handle(Event $event)
continue;
}

$real_key = $type . '.' . $key;

setting()->set($real_key, $value);
}
}
Expand Down

0 comments on commit ab5a55f

Please sign in to comment.