<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;
use App\CategoryDescription;
use App\PageDescription;
use App\Models;
use App\Http\Resources\CountryResource;
use App\Http\Resources\AttributeResource;

class RateResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
     
    public function toArray($request)
    {
        
       
       
        $data =  [
            'id' => $this->id,
            'rate'=>$this->rate,
            'comment'=>$this->comment,
            
            
            'user'=>new MemberResource($this->whenLoaded('user')),
            'store'=>new StoreResource($this->whenLoaded('store')),
            
            
            
            
            
      ];
      
      if(\Auth::user()){
          
      }
      else{
          
      }
      return $data;
    }
}
