mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
28 lines
640 B
PHP
28 lines
640 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class TransactionDetailResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
|
|
return [
|
|
'id' => $this->id,
|
|
'stockCode' => $this->product_code,
|
|
'description' => $this->product_name,
|
|
'quantity' => $this->quantity,
|
|
'unit_price' => (double) $this->price,
|
|
'total' => (double) $this->amount
|
|
];
|
|
}
|
|
}
|