<?php

namespace Modules\Address\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;
use Modules\Country\Http\Resources\CountryResource;
use Modules\Country\Http\Resources\RegionResource;

class AddressResource extends JsonResource
{
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'lat' => $this->lat,
            'long' => $this->long,
            'block' => $this->block,
            'road' => $this->road,
            'building' => $this->building,
            'apartment' => $this->apartment,
            'additional_directions' => $this->additional_directions,
            'Country' => CountryResource::make($this->Country),
            'Region' => RegionResource::make($this->Region),
        ];
    }
}
