{{ __(':name Member', ['name' => $rank->name]) }}
{{ $rank->description }}
@extends('frontend.layouts.user.index') @section('title', __('All Ranks')) @section('content') @php $user = auth()->user(); $currencySymbol = siteCurrency('symbol'); $earnedRankIds = collect((array) ($user?->old_ranks ?? [])) ->push($user?->rank_id) ->filter() ->map(fn ($rankId): int => (int) $rankId) ->unique() ->values(); $currentRank = $userRanks->firstWhere('id', $user?->rank_id) ?? $userRanks->first(fn ($rank) => $earnedRankIds->contains((int) $rank->id)); $nextRank = $userRanks->first(fn ($rank) => ! $earnedRankIds->contains((int) $rank->id)); $walletValues = $userRanks->map(fn ($rank) => data_get($rank->features, 'wallet_create', 0)); $maxWallets = $walletValues->contains('unlimited') ? __('Unlimited') : ($walletValues->max() ?? 0); $maxReferral = $userRanks->max('features.referral_level') ?? 0; $maxReward = $currencySymbol . number_format((float) ($userRanks->max('reward') ?? 0),siteDecimalPlaces()); $topVolume = $currencySymbol . number_format((float) ($userRanks->max('transaction_amount') ?? 0),siteDecimalPlaces()); $totalRanks = $userRanks->count(); $unlockedCount = $userRanks ->filter(fn ($rank) => $earnedRankIds->contains((int) $rank->id)) ->count(); $completionPercent = $totalRanks > 0 ? min(100, (int) round(($unlockedCount / $totalRanks) * 100)) : 0; @endphp
{{ __(':unlocked of :total ranks unlocked. Next target: :next with rewards up to :reward, :wallets wallets, and :referrals referral levels.', [ 'unlocked' => $unlockedCount, 'total' => $totalRanks, 'next' => $nextRank ? $nextRank->name : __('Top tier'), 'reward' => $maxReward, 'wallets' => $maxWallets, 'referrals' => $maxReferral, ]) }}
{{ $rank->description }}