<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class ProductListResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param \Illuminate\Http\Request $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id'                => $this->id,
            'name'              => $this->name,
            'slug'              => $this->slug,
            'sku'               => $this->sku,
            'price'             => $this->price,
            'discount_amount'   => $this->discount_amount,
            'discount_price'    => $this->discount_price,
            'thumbnail'         => $this->thumbnail,
            'weight'            => $this->weight,
            'dimensions'        => $this->dimensions,
            'short_description' => $this->short_description,
            'description'       => $this->description,
            'information'       => $this->information,
            'in_stock'          => $this->in_stock,
            'rating_avg'        => $this->rating_avg,
            'brand_list'        => $this->brand_list,
        ];
    }
}
