商品图片功能

This commit is contained in:
TL 2022-07-26 16:16:51 +08:00
parent 78302f4591
commit cfc6af6536
2 changed files with 3 additions and 2 deletions

View File

@ -16,7 +16,9 @@ class ProductResource extends JsonResource
{
$data = [
'id' => $this->id,
'image' => thumbnail($this->image),
'images' => array_map(function ($image) {
return thumbnail($image);
}, $this->images ?? []),
'name' => $this->description->name ?? '',
'price_formatted' => $this->price_formatted,
'active' => $this->active,

View File

@ -16,7 +16,6 @@ class Product extends Base
];
protected $casts = [
'active' => 'boolean',
'images' => 'array',
'variables' => 'array',
'images' => 'array',
];