<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class FortunetellerResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param \Illuminate\Http\Request $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id'                   => $this->id,
            'number'               => $this->number,
            'slug'                 => $this->slug,
            'name'                 => $this->name,
            'display_name'         => $this->display_name,
            'gender'               => $this->gender,
            'age'                  => $this->age,
            'address'              => $this->address,
            'avatar'               => ($this->avatar != null && $this->avatar != "") ? $this->avatar : "no-image.png",
            'desc_1_image'         => $this->desc_1_image,
            'desc_1_title'         => $this->desc_1_title,
            'desc_1_short'         => $this->desc_1_short,
            'desc_1_full'          => $this->desc_1_full,
            'desc_2_image'         => $this->desc_2_image,
            'desc_2_title'         => $this->desc_2_title,
            'desc_2_short'         => $this->desc_2_short,
            'desc_2_full'          => $this->desc_2_full,
            'cost'                 => $this->cost,
            'consultation_minutes' => $this->consultation_minutes,
            'performance'          => $this->performance,
            'use_scry'             => $this->use_scry,
            'consultation_genre'   => $this->consultation_genre,
            'good_consultation'    => $this->good_consultation,
            'commitment'           => $this->commitment,
            'boom'                 => $this->boom,
            'message'              => $this->message,
            'message_image'        => $this->message_image,
            'filter_name'          => $this->filter_name,
            'slider'               => isset($this->slider) ? $this->slider : [],
            'gallery'              => isset($this->gallery) ? $this->gallery : [],
            'plan'                 => isset($this->plan) ? $this->plan : [],
            'info'                 => isset($this->info) ? $this->info : [],
            'profile'              => isset($this->profile) ? $this->profile : [],
            'review'               => isset($this->review) ? $this->review : [],
            'method'               => isset($this->methodDetail) ? $this->methodDetail : [],
            'show_top'             => $this->show_top,
            'created_at'           => $this->created_at,
        ];
    }
}
