Skip to content

Commit

Permalink
Fix upload image svg
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Lagarda committed Nov 15, 2019
1 parent 37f5e55 commit 5856c88
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Controllers/SettingsCardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ private function getRequestValue($request, $key, $value)
$disk = $this->disks->get($key);
}

$this->deletePreviusImage($key, $disk);
$this->deletePreviousImage($key, $disk);

$path = $request->{$key}->store('', $disk);
$fileName = sha1($value->getClientOriginalName()).'.'.$value->getClientOriginalExtension();

$path = $request->{$key}->storeAs('', $fileName, $disk);

return json_encode([
'path' => $path,
Expand All @@ -77,7 +79,7 @@ private function getRequestValue($request, $key, $value)
/**
* @param $key
*/
private function deletePreviusImage($key, $disk)
private function deletePreviousImage($key, $disk)
{
$data = setting($key, false);
if ($data !== false) {
Expand Down

0 comments on commit 5856c88

Please sign in to comment.