<?php

namespace Litecms\Country\Repositories\Presenter;

use League\Fractal\TransformerAbstract;
use Hashids;

class CountryTransformer extends TransformerAbstract
{
    public function transform(\Litecms\Country\Models\Country $country)
    {
        return [
            'id'                => $country->getRouteKey(),
            'key'               => [
                'public'    => $country->getPublicKey(),
                'route'     => $country->getRouteKey(),
            ], 
            'country_id'        => $country->country_id,
            'country'           => $country->country,
            'url'               => [
                'public'    => trans_url('country/'.$country->getPublicKey()),
                'user'      => guard_url('country/country/'.$country->getRouteKey()),
            ], 
            'status'            => trans('app.'.$country->status),
            'created_at'        => format_date($country->created_at),
            'updated_at'        => format_date($country->updated_at),
        ];
    }
}