<?php


namespace App\Http\Transformers\Front;


use App\Models\Area;
use League\Fractal\TransformerAbstract;

class AreaTransformer extends TransformerAbstract
{

    public function transform(Area $area): array
    {

        $array = [
            'id' => (integer) $area->id,
            'name' => (string) $area->name,
            'city' => (string) $area->city->name,
        ];

        return $array;

    }


}
