exchange/app/Transformers/TradingTransformer.php

26 lines
741 B
PHP
Raw Normal View History

2022-11-27 12:32:32 +00:00
<?php
namespace App\Transformers;
use App\Models\Trading;
use League\Fractal\TransformerAbstract;
class TradingTransformer extends TransformerAbstract
{
public function transform(Trading $trading)
{
return [
'id' => $trading->id,
'title' => $trading->title,
'unit' => $trading->unit,
'price' => $trading->price,
'old_price' => $trading->old_price,
'price_change' => $trading->price_change,
'amount' => $trading->amount,
'currency' => $trading->currency,
'seller_country' => $trading->seller_country,
'buyer_country' => $trading->buyer_country,
'point' => $trading->point,
];
}
}