mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-23 22:44:03 +00:00
Merge branch 'development' of gitlab.com:CIEFWorldwideSdnBhd/exchange-2.0 into wallet-ui
# Conflicts: # resources/views/partials/header.blade.php # routes/web.php
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class WalletResource extends JsonResource
|
||||
@@ -19,7 +20,17 @@ class WalletResource extends JsonResource
|
||||
'code' => $this->code,
|
||||
'currency_id' => $this->currency_id,
|
||||
'amount' => (double) $this->amount,
|
||||
'company_id' => (int) $this->company_id
|
||||
'company_id' => (int) $this->owner->id,
|
||||
'transactions' => $this->transactions()->orderBy('id', 'DESC')->get(),
|
||||
'topup_transactions' => $this->transactions()->where('type', TransactionType::TOP_UP)->orderBy('id', 'DESC')->get(),
|
||||
|
||||
// 'transaction' => $this->whenLoaded('transactions', function() {
|
||||
// return [
|
||||
// 'topup' => $this->transactions
|
||||
// ];
|
||||
// }),
|
||||
// 'transaction' // all
|
||||
// 'top_transaction' // only topup
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user