Files
shipping-portal/app/Transformers/CurrencyTransformer.php

44 lines
827 B
PHP

<?php
namespace App\Transformers;
use App\Models\Currency;
use League\Fractal\TransformerAbstract;
class CurrencyTransformer extends TransformerAbstract
{
/**
* List of resources to automatically include
*
* @var array
*/
protected $defaultIncludes = [
//
];
/**
* List of resources possible to include
*
* @var array
*/
protected $availableIncludes = [
//
];
/**
* A Fractal transformer.
*
* @param Currency $currency
* @return array
*/
public function transform(Currency $currency): array
{
return [
'id' => $currency->id,
'name' => $currency->name,
'short_code' => $currency->short_code,
'phone_code' => $currency->phone_code,
];
}
}