6
0
Fork 0
jiqu-library-server/app/Endpoint/Api/Http/Resources/StoreProductResource.php

22 lines
585 B
PHP

<?php
namespace App\Endpoint\Api\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class StoreProductResource extends JsonResource
{
public function toArray($request)
{
return [
'id' => $this->id,
'name' => $this->name,
'cover' => (string) $this->cover,
'sell_price' => (string) $this->sell_price_format,
'vip_price' => (string) $this->vip_price_format,
'market_price' => (string) $this->market_price_format,
'amount' => (int) $this->pivot->amount
];
}
}