<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class QuestionResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
     
    public function toArray($request)
    {
        
       
       
        $data =  [
            'id' => $this->id,
           'question' => $this->descriptions(currentLanguage()->id)['question'],
           'answer'=>strip_tags($this->descriptions(currentLanguage()->id)['answer']),
            
            
            
            
            
      ];
      return $data;
    }
}
