|
|
@@ -2,7 +2,6 @@
|
|
|
|
|
|
namespace Dcat\Admin\Traits;
|
|
|
|
|
|
-use Illuminate\Support\Facades\Storage;
|
|
|
use Illuminate\Support\Str;
|
|
|
|
|
|
trait Resizable
|
|
|
@@ -18,7 +17,7 @@ trait Resizable
|
|
|
public function thumbnail($type, $attribute = 'image', $disk = null)
|
|
|
{
|
|
|
// Return empty string if the field not found
|
|
|
- if (! isset($this->attributes[$attribute])) {
|
|
|
+ if (!isset($this->attributes[$attribute])) {
|
|
|
return '';
|
|
|
}
|
|
|
|
|
|
@@ -27,7 +26,7 @@ trait Resizable
|
|
|
|
|
|
$thumbnail = $this->getThumbnailPath($image, $type);
|
|
|
|
|
|
- return Storage::disk($disk ?: config('admin.upload.disk'))->exists($thumbnail) ? $thumbnail : null;
|
|
|
+ return $thumbnail;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -44,9 +43,9 @@ trait Resizable
|
|
|
$ext = pathinfo($image, PATHINFO_EXTENSION);
|
|
|
|
|
|
// We remove extension from file name so we can append thumbnail type
|
|
|
- $name = Str::replaceLast('.'.$ext, '', $image);
|
|
|
+ $name = Str::replaceLast('.' . $ext, '', $image);
|
|
|
|
|
|
// We merge original name + type + extension
|
|
|
- return $name.'-'.$type.'.'.$ext;
|
|
|
+ return $name . '-' . $type . '.' . $ext;
|
|
|
}
|
|
|
}
|