26 lines
676 B
PHP
26 lines
676 B
PHP
<?php
|
|
|
|
namespace Sarga\API\Http\Resources\Customer;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
use Sarga\API\Http\Resources\Catalog\Product;
|
|
|
|
class WishListResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'product' => new Product($this->product),
|
|
'created_at' => $this->created_at,
|
|
'updated_at' => $this->updated_at,
|
|
'old_price' => (double) core()->convertPrice($this->price),
|
|
];
|
|
}
|
|
} |