mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 06:04:08 -08:00
Fixed syntax error in image upload request from mangled merge
This commit is contained in:
parent
c38bbfc8bd
commit
29b05d2020
|
@ -81,7 +81,7 @@ class ImageUploadRequest extends Request
|
||||||
$upload = Image::make($image->getRealPath())->resize(null, $w, function ($constraint) {
|
$upload = Image::make($image->getRealPath())->resize(null, $w, function ($constraint) {
|
||||||
$constraint->aspectRatio();
|
$constraint->aspectRatio();
|
||||||
$constraint->upsize();
|
$constraint->upsize();
|
||||||
})
|
});
|
||||||
|
|
||||||
// This requires a string instead of an object, so we use ($string)
|
// This requires a string instead of an object, so we use ($string)
|
||||||
Storage::disk('public')->put($path.'/'.$file_name, (string)$upload->encode());
|
Storage::disk('public')->put($path.'/'.$file_name, (string)$upload->encode());
|
||||||
|
@ -117,18 +117,17 @@ class ImageUploadRequest extends Request
|
||||||
|
|
||||||
// If the user isn't uploading anything new but wants to delete their old image, do so
|
// If the user isn't uploading anything new but wants to delete their old image, do so
|
||||||
} elseif ($this->input('image_delete')=='1') {
|
} elseif ($this->input('image_delete')=='1') {
|
||||||
Storage::disk('public')->delete($path.'/'.$item->{$fieldname});
|
|
||||||
$item->{$fieldname} = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
unlink($path.'/'.$item->image);
|
Storage::disk('public')->delete($path.'/'.$item->{$fieldname});
|
||||||
|
$item->{$fieldname} = null;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
\Log::debug($e);
|
\Log::debug($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
$item->image = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return $item;
|
return $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue