26 lines
741 B
PHP
26 lines
741 B
PHP
<?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,
|
|
];
|
|
}
|
|
} |