%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/diaspora/api/app/Transformers/
Upload File :
Create Path :
Current File : /var/www/html/diaspora/api/app/Transformers/CountryTransformer.php

<?php

namespace App\Transformers;

use App\Models\Country;

class CountryTransformer extends BaseTransformer
{
    /**
     * @param Country $country
     *
     * @return array
     */
    public function transform(Country $country)
    {
        return [
            'id'                         => $country->id,
            'iso_2'                      => $country->iso_2,
            'is_enabled'                 => $country->is_enabled,
            'travel_precaution'          => $country->travel_precaution,
            'travel_precaution_readable' => $country->travel_precaution
                ? trans("cautions.$country->travel_precaution")
                : '',
            'name'                       => $country->name,
            'can_be_enabled'             => $country->canBeEnabled(),
            'available_in'               => $country->translations()
                                                    ->get()
                                                    ->pluck('locale'),
        ];
    }
}

Zerion Mini Shell 1.0