<?php

namespace App\Http\Resources\Api\Dashboard\Admin\Product;

use Illuminate\Http\Resources\Json\JsonResource;

class ProductCarbResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
     */
    public function toArray($request)
    {
        return [
            'id'                => $this->id,
            'total_carbs'       => $this->total_carbs,
            'sugar'             => $this->sugar,
            'added_sugar'       => $this->added_sugar,
            'fiber'             => $this->fiber,
            'sugar_alcohol'     => $this->sugar_alcohol,
            'glycerin'          => $this->glycerin,
            'erythritol'        => $this->erythritol,
            'polyols'           => $this->polyols,
        ];
    }
}
