<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class City extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
                'id' => $this->id ? $this->id : '',
                'name' => $this->name ? $this->name : "",
                'code' => $this->code ? $this->code : '',
                'region_center' => $this->region_center ? true : false
        ];
//
//        return [
//            'id' => $this->id ? $this->id : "",
//            'name' => $this->name ? $this->name : "",
//            'code' => $this->code ? $this->code : "",
//            'priority' => $this->priority,
//            'region_center' => $this->region_center ? true : false,
//            'region_id' => $this->region ? $this->region->id : 1,
//            'enabled' => $this->enabled ? true : false,
//            'center_address' => $this->center_address,
//            'center_latitude' => $this->center_latitude,
//            'center_longitude' => $this->center_longitude,
//        ];
    }
}
