diff --git a/app/Http/Resources/DocumentForTransactionUrgentResource.php b/app/Http/Resources/DocumentForTransactionUrgentResource.php new file mode 100644 index 00000000..59c581c6 --- /dev/null +++ b/app/Http/Resources/DocumentForTransactionUrgentResource.php @@ -0,0 +1,29 @@ + $this->id, + // 'reference' => $this->reference, + // 'status' => (int) $this->status, + // 'document_type' => $this->document_type, + // 'owner' => $this->relationLoaded('owner') ? ($this->owner instanceof Booking ? new BookingResource($this->owner) : new CompanyResource($this->owner)) : null, + // 'files' => FileResource::collection($this->files), + 'created_at' => Carbon::parse($this->created_at)->format('d-m-Y h:i:s A') + ]; + } +} diff --git a/app/Http/Resources/TransactionUrgentResource.php b/app/Http/Resources/TransactionUrgentResource.php index c36b8de8..04edd0d1 100644 --- a/app/Http/Resources/TransactionUrgentResource.php +++ b/app/Http/Resources/TransactionUrgentResource.php @@ -52,7 +52,7 @@ class TransactionUrgentResource extends JsonResource // 'currency_rate' => (double) $this->currency_rate, // 'status' => (int) $this->status, //'details' => TransactionDetailResource::collection($this->transactionDetails), - 'documents' => new DocumentResource($this->documents()->first()), + 'documents' => new DocumentForTransactionUrgentResource($this->documents()->first()), //'transaction_bill' => new TransactionResource($this->when((int) $this->type === TransactionType::PAYMENT, $this->transactions()->bills()->first())), //'transaction_refunds' => TransactionResource::collection($this->when((int) $this->type === TransactionType::PAYMENT, $this->transactions()->refunds()->get())), //'refunded_amount' => $this->booking ? floatval((App()->make(CalculatesBookingRefundAmount::class))->calculateRefundAmount($this->resource, $this->booking->fix_currency_id)) : null,