商品图片功能
This commit is contained in:
parent
78302f4591
commit
cfc6af6536
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ class Product extends Base
|
|||
];
|
||||
protected $casts = [
|
||||
'active' => 'boolean',
|
||||
'images' => 'array',
|
||||
'variables' => 'array',
|
||||
'images' => 'array',
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in New Issue