@extends('frontend.layouts.user.index') @section('title', __('Trader').': '.$user->name) @section('content') @use('Illuminate\Support\Str') @php $userName = $user->name ?? __('User'); $initials = strtoupper(substr((string) $user?->first_name, 0, 1).substr((string) $user?->last_name, 0, 1)); $initials = $initials !== '' ? $initials : strtoupper(substr((string) $userName, 0, 1)); $isVerified = $user ? $user->isKycVerified() : false; $avgRatingValue = $avgRating !== null ? number_format((float) $avgRating, 1) : null; $activeAdsCount = method_exists($offers, 'total') ? (int) $offers->total() : (int) $offers->count(); $positiveRate = $feedbackCount > 0 ? round(($positiveFeedback / $feedbackCount) * 100, 1) : null; $isTrustedTrader = $totalOrders >= 10 && $completionRate >= 95 && (($avgRating !== null && $avgRating >= 4.5) || $positiveFeedback >= 10); $isHighVolumeTrader = $completedOrders >= 50; $memberSince = $user?->created_at?->translatedFormat('M Y'); $profileLabel = match (true) { $isTrustedTrader => __('Trusted Trader'), $isVerified => __('Verified Profile'), default => __('Growing Profile'), }; $trustState = match (true) { $isTrustedTrader => 'is-trusted', $isVerified => 'is-verified', default => 'is-growing', }; $trustScore = (int) round(min( 99, ($completionRate * 0.55) + ((($avgRating ?? 0) / 5) * 30) + (($positiveRate ?? 0) * 0.15) + ($isVerified ? 8 : 0) )); $trustScore = max($isVerified ? 42 : 18, $trustScore); $metrics = [ ['label' => __('Trades'), 'value' => number_format($completedOrders), 'note' => __('completed'), 'icon' => 'fa-check-double'], ['label' => __('Completion'), 'value' => number_format($completionRate, 1).'%', 'note' => __('success rate'), 'icon' => 'fa-chart-line'], ['label' => __('Rating'), 'value' => $avgRatingValue ? $avgRatingValue.'/5' : '—', 'note' => number_format($feedbackCount).' '.__('reviews'), 'icon' => 'fa-star'], ['label' => __('Live Ads'), 'value' => number_format($activeAdsCount), 'note' => __('available'), 'icon' => 'fa-layer-group'], ]; $tradeNotes = [ __('Use a payment account that matches the trader holder name.'), __('Start with a smaller limit until the flow feels consistent.'), __('Release crypto only after the incoming payment fully settles.'), ]; @endphp
{{ filled($fb->comment) ? Str::limit((string) $fb->comment, 110) : __('No comment added.') }}
@lang('Review live ads, verification status, and payment terms before starting your first order.')
@lang('Compare rate, payment method, and order limit before opening a trade.')