商品图片功能
This commit is contained in:
parent
78302f4591
commit
cfc6af6536
|
|
@ -16,7 +16,9 @@ class ProductResource extends JsonResource
|
||||||
{
|
{
|
||||||
$data = [
|
$data = [
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'image' => thumbnail($this->image),
|
'images' => array_map(function ($image) {
|
||||||
|
return thumbnail($image);
|
||||||
|
}, $this->images ?? []),
|
||||||
'name' => $this->description->name ?? '',
|
'name' => $this->description->name ?? '',
|
||||||
'price_formatted' => $this->price_formatted,
|
'price_formatted' => $this->price_formatted,
|
||||||
'active' => $this->active,
|
'active' => $this->active,
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ class Product extends Base
|
||||||
];
|
];
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'active' => 'boolean',
|
'active' => 'boolean',
|
||||||
'images' => 'array',
|
|
||||||
'variables' => 'array',
|
'variables' => 'array',
|
||||||
'images' => 'array',
|
'images' => 'array',
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue