mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 20:44:19 +00:00
44 lines
827 B
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,
|
|
];
|
|
}
|
|
}
|