Files
portal/app/Http/Resources/ReceiptDetailResource.php
T

30 lines
715 B
PHP

<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class ReceiptDetailResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return [
'id' => $this->id,
'trans_type1' => $this->trans_type1,
'trans_type2' => $this->trans_type2,
'transaction_id' => (int) $this->transaction_id,
'receipt_id' => (int)$this->receipt_id,
'price' => (double) $this->price,
'amount' => (double) $this->amount
];
}
}