mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-27 08:24:06 +00:00
large commit
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class TransactionResource extends JsonResource
|
||||
@@ -14,21 +15,21 @@ class TransactionResource extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
|
||||
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'trans_type1' => $this->trans_type1,
|
||||
'trans_type2' => $this->trans_type2,
|
||||
'bill_no' => (int) $this->bill_no,
|
||||
'booking' => new BookingResource($this->booking),
|
||||
'bill_no' => $this->bill_no,
|
||||
'amount' => (double) $this->amount,
|
||||
'currency_id' => (int) $this->currency_id,
|
||||
'original_amount' => (double) $this->original_amount,
|
||||
'original_currency_id' => (int) $this->original_currency_id,
|
||||
'currency' => new CurrencyResource($this->currency),
|
||||
'original_currency' => new CurrencyResource($this->original_currency),
|
||||
'currency_rate' => (double) $this->currency_rate,
|
||||
'dt_transaction' => $this->dt_transaction,
|
||||
'status' => (int) $this->status,
|
||||
'booking_id' => (int) $this->booking_id,
|
||||
'company_id' => (int) $this->company_id
|
||||
'details' => TransactionDetailResource::collection($this->transactionDetails),
|
||||
'documents' => new DocumentResource($this->documents()->first()),
|
||||
'expires_on' => Carbon::parse($this->expires_on)->format('d-m-Y h:s:i'),
|
||||
'updated_at' => Carbon::parse($this->update_at)->format('d-m-Y h:s:i')
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user