WIP
This commit is contained in:
@@ -15,9 +15,8 @@ class ProductMediaResource extends JsonResource
|
|||||||
public function toArray(Request $request): array
|
public function toArray(Request $request): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'thumbnail' => $this->getUrl('thumb288x431'),
|
'thumbnail' => $this->getUrl('thumb400x400'),
|
||||||
'images_400x400' => $this->getUrl('thumb400x400'),
|
'images_400x400' => $this->getUrl('thumb400x400'),
|
||||||
'images_720x720' => $this->getUrl('thumb720x720'),
|
|
||||||
'images_800x800' => $this->getUrl('thumb800x800'),
|
'images_800x800' => $this->getUrl('thumb800x800'),
|
||||||
'images_1200x1200' => $this->getUrl('thumb1200x1200'),
|
'images_1200x1200' => $this->getUrl('thumb1200x1200'),
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ use Illuminate\Support\Str;
|
|||||||
class ShortFileNamer extends FileNamer
|
class ShortFileNamer extends FileNamer
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Keep the original file name exactly as it was uploaded.
|
* Generate a short random name for the original file.
|
||||||
*/
|
*/
|
||||||
public function originalFileName(string $fileName): string
|
public function originalFileName(string $fileName): string
|
||||||
{
|
{
|
||||||
return pathinfo($fileName, PATHINFO_FILENAME);
|
return Str::random(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -20,7 +20,9 @@ class ShortFileNamer extends FileNamer
|
|||||||
*/
|
*/
|
||||||
public function conversionFileName(string $fileName, Conversion $conversion): string
|
public function conversionFileName(string $fileName, Conversion $conversion): string
|
||||||
{
|
{
|
||||||
return Str::random(12);
|
$fileName = pathinfo($fileName, PATHINFO_FILENAME);
|
||||||
|
|
||||||
|
return "{$fileName}-{$conversion->getName()}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function responsiveFileName(string $fileName): string
|
public function responsiveFileName(string $fileName): string
|
||||||
|
|||||||
Reference in New Issue
Block a user