<?php

namespace App\Http\Controllers\Api\V1\Product\Resources\Review;

use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class ProductReviewResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  Request  $request
     * @return array|Arrayable|\JsonSerializable
     */
    public function toArray($request): array
    {
        return [
            'id' => $this->id,
            'user_id' => $this->user_id,
            'product_id' => $this->product_id,
            'rating' => $this->rating,
            'title' => $this->title,
            'content' => $this->content,
            'is_recommended' => $this->is_recommended,
            'source' => $this->source,
        ];
    }
}
