<?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 PageResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
     
    public function toArray($request)
    {
        
       
       
        $data =  [
            'id' => $this->id,
            'image'=>asset('').$this->image,
            'icon'=> is_null($this->icon) ? null : asset('').$this->icon,
            'name' => $this->descriptions(currentLanguage()->id)['title'],
           'description'=>strip_tags($this->descriptions(currentLanguage()->id)['description']),
            
            
            
            
            
      ];
      return $data;
    }
}
