File "ReviewResource.php"

Full Path: /home/clickysoft/public_html/jmapi5.clickysoft.net/app/Http/Resources/Admin/ReviewResource.php
File size: 595 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

namespace App\Http\Resources\Admin;

use Illuminate\Http\Resources\Json\JsonResource;

class ReviewResource extends JsonResource
{
    public function toArray($request)
    {
//        return parent::toArray($request);
        return [
            'id' => $this->id,
            'product' => $this->product?->name,
            'user'    => $this->user?->name,
            'rating'  => $this->rating,
            'comment' => $this->comment,
            'created_at' => $this->created_at->format('m-d-Y'),
            'updated_at' => $this->updated_at->format('m-d-Y'),
        ];
    }
}