<?php

namespace App\Http\Resources;

use App\Country;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

/**
 * @property mixed id
 * @property mixed name
 * @property mixed price
 */
class CityResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  Request  $request
     * @return array
     */
    public function toArray($request)
    {
        $addedValue = settings('added_value');
        return [
            'id' => $this->id,
            'price' => $this->price+(($this->price*$addedValue)/100),
            'price_without_tax' => $this->price,
            'name' => $this->name
        ];
    }
}
