Add full url while save image
This commit is contained in:
parent
4093ebf894
commit
601f608b83
|
@ -85,6 +85,9 @@ trait Helper
|
||||||
return $money->formatTo(app()->getLocale());
|
return $money->formatTo(app()->getLocale());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AppException
|
||||||
|
*/
|
||||||
public function uploadImage(UploadedFile $file, $imageCode, $folderName)
|
public function uploadImage(UploadedFile $file, $imageCode, $folderName)
|
||||||
{
|
{
|
||||||
$original_filename = $file->getClientOriginalName();
|
$original_filename = $file->getClientOriginalName();
|
||||||
|
@ -101,9 +104,9 @@ trait Helper
|
||||||
|
|
||||||
$compressedImage = compressImage($file, './' . $folderName . '/' . $image, 70);
|
$compressedImage = compressImage($file, './' . $folderName . '/' . $image, 70);
|
||||||
if ($compressedImage) {
|
if ($compressedImage) {
|
||||||
return $image;
|
return url($folderName . '/' . $image);
|
||||||
} else {
|
} else {
|
||||||
return $this->errorResponse(trans('errors.compression_failed'));
|
throw new AppException(trans('errors.compression_failed'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue