@php
if (in_array($transaction->transaction_type?->id, [Deposit, Withdrawal])) {
$transactionImage = null;
$directoryName = $transaction->payment_method?->name;
} else if (in_array($transaction->transaction_type?->id, [Transferred, Received, Request_Sent, Request_Received])) {
$transactionImage = $transaction->end_user?->picture ?? null;
$directoryName = 'profile';
} else if (in_array($transaction->transaction_type?->id, [Exchange_From, Exchange_To])) {
$transactionImage = $transaction->currency?->logo;
$directoryName = 'currency';
} else if (in_array($transaction->transaction_type?->id, [Payment_Sent, Payment_Received])) {
$transactionImage = $transaction->merchant?->logo;
$directoryName = 'merchant';
} else if (in_array($transaction->transaction_type?->id, [Crypto_Sent, Crypto_Received])) {
$transactionImage = $transaction->end_user?->picture ?? null;
$directoryName = 'profile';
} else {
$transactionImage = null;
$directoryName = null;
}
@endphp
{{ strpos($transaction->transaction_type?->name, '_') !== false ? str_replace('_', ' ', $transaction->transaction_type?->name) : $transaction->transaction_type?->name }}
@php
if (in_array($transaction->transaction_type?->id, [Deposit, Withdrawal, Payment_Sent, Payment_Received, Crypto_Sent])) {
$transactionInfo = $transaction->payment_method?->id == Mts ? settings('name') : $transaction->payment_method?->name;
} else if (in_array($transaction->transaction_type?->id, [Transferred, Received, Request_Sent, Request_Received, Crypto_Received])) {
$transactionInfo = getColumnValue($transaction->end_user, 'first_name', 'last_name', 'unregistered');
} else if (in_array($transaction->transaction_type?->id, [Exchange_From, Exchange_To])) {
$transactionInfo = $transaction->currency?->code;
} else {
$transactionInfo = null;
$directoryName = null;
}
@endphp
{{ $transactionInfo }}
{{ dateFormat($transaction->created_at) }}