@php use App\Enums\LedgerTnxType; use App\Enums\TransactionCalcType; $type = data_get($transaction, 'type'); $meta = json_decode(data_get($transaction, 'meta')); $badge_class = 'badge-dark'; if(LedgerTnxType::INVEST==$type) { $badge_class = 'badge-info'; } if(LedgerTnxType::CAPITAL==$type) { $badge_class = 'badge-success'; } if(LedgerTnxType::PROFIT==$type) { $badge_class = 'badge-success'; } if(LedgerTnxType::TRANSFER==$type) { $badge_class = 'badge-warning'; } if(LedgerTnxType::LOSS==$type || LedgerTnxType::PENALTY==$type ) { $badge_class = 'badge-danger'; } if ($transaction->is_manual) { $method = "manual"; } else { $method = ""; } @endphp