<?php

namespace Modules\Linksehat\Transformers\Article;

use Illuminate\Http\Resources\Json\JsonResource;

class ArticleResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'nID' => $this->nID,
            'sSlug' => $this->sSlug,
            'title' => $this->sJudulArtikel,
            'deskripsi' => $this->sMetaDeskripsi,
            'photos' => [
                'title' => $this->sSlug,
                'url' => $this->sImages
            ]
        ];
    }
}
