<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class ProductDetailResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param \Illuminate\Http\Request $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id'                  => $this->id,
            'code'                => $this->id,
            'sku'                 => $this->sku,
            'name'                => $this->name,
            'slug'                => $this->slug,
            'image'               => ($this->image == null || $this->image == "") ? 'no-image.png' : $this->image,
            'gender'              => $this->gender,
            'size'                => $this->size,
            'material'            => $this->material,
            'dimension_cm'        => $this->dimension_cm,
            'dimension_scale'     => $this->dimension_scale,
            'height'              => $this->height,
            'sleeve'              => $this->sleeve,
            'sleeve_length'       => $this->sleeve_length,
            'hip'                 => $this->hip,
            'primary_width'       => $this->primary_width,
            'second_width'        => $this->second_width,
            'undergarment_length' => $this->undergarment_length,
            'rank'                => $this->rank,
            'explanation'         => $this->explanation,
            'kimimono'            => $this->kimimono,
            'description'         => $this->description,
            'note'                => $this->note,
            'images'              => $this->images,
            'default_price'       => $this->default_price,
            'regular_price_from'  => $this->regular_price_from,
            'scene_id'            => $this->scene_id,
            'scene'               => $this->scene,
            'wish_list'           => $this->wish_list,
            'category'            => $this->category,
            'color_detail'        => $this->color_detail,
            'schedule'            => $this->schedule,
            'user'                => $this->user,
            'is_allow_faceswap'   => $this->is_allow_faceswap
        ];
    }
}
