<?php

namespace TPS\Birzha\Classes;

use Illuminate\Http\Resources\Json\JsonResource;
 
class MeasureResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        $locale = $request->header('locale');

        return [
            'name' => $this->getAttributeTranslated('name', $locale),
        ];
    }
}