@extends('frontend.layouts.user.index') @section('title', __('My Trade Ads')) @section('content') {{-- My Trade Ads: status overview, promotion state, and quick lifecycle actions for owned trade ads --}} @php $summaryCards = [ [ 'label' => __('Total Ads'), 'value' => (int) ($summary['total_offers'] ?? 0), 'icon' => 'fa-layer-group', 'tone' => 'primary', ], [ 'label' => __('Live Ads'), 'value' => (int) ($summary['active_offers'] ?? 0), 'icon' => 'fa-check-circle', 'tone' => 'success', ], [ 'label' => __('Promoted Ads'), 'value' => (int) ($summary['promoted_offers'] ?? 0), 'icon' => 'fa-bullhorn', 'tone' => 'warning', ], [ 'label' => __('Open Trades'), 'value' => (int) ($summary['open_orders'] ?? 0), 'icon' => 'fa-sync-alt', 'tone' => 'info', ], [ 'label' => __('Completed Trades'), 'value' => (int) ($summary['completed_orders'] ?? 0), 'icon' => 'fa-check-double', 'tone' => 'success-soft', ], ]; @endphp
@lang('My Orders') @lang('Marketplace') @lang('New Ad')
@foreach($summaryCards as $card)
{{ $card['label'] }} {{ number_format($card['value']) }}
@endforeach
@lang('My Trade Ads')
{{-- Owned trade ad cards --}}
@forelse($offers as $offer) @php $currency = $offer->wallet->currency->code; $decimals = (int) setting('site_decimal', 2); $fiatCurrency = siteCurrency('code') ?: $currency; $priceText = number_format((float) $offer->price, $decimals); $limitText = number_format((float) $offer->min_amount, $decimals) . ' - ' . ($offer->max_amount !== null ? number_format((float) $offer->max_amount, $decimals) : __('∞')); $paymentMethods = $offer->paymentMethods->filter(fn ($method) => !empty($method?->name))->pluck('name')->values(); $paymentMethodsText = $paymentMethods->take(2)->implode(', '); $hasOpenOrders = (int) ($offer->active_orders_count ?? 0) > 0; $isDisabled = $offer->status === \App\Enums\P2P\OfferStatus::DISABLED; $promotion = $offer->promotion; $isPromoted = $promotion && $promotion->status === \App\Enums\P2P\PromotionStatus::ACTIVE && $promotion->ends_at && $promotion->ends_at->isFuture(); $visibilityText = $offer->status === \App\Enums\P2P\OfferStatus::ACTIVE ? __('Visible in Marketplace') : ($offer->status === \App\Enums\P2P\OfferStatus::PAUSED ? __('Paused from Marketplace') : __('Not Available')); $readinessText = $hasOpenOrders ? __('Has open trade activity') : ($isDisabled ? __('Requires system attention') : __('Ready to receive trade requests')); @endphp
#{{ $offer->id }} · {{ $offer->side->label() }} {{ $currency }}
{{ $offer->status->label() }} @if($isPromoted) @lang('Promoted') @endif
@lang('Rate') {{ $priceText }} {{ $fiatCurrency }}
@lang('Limits') {{ $limitText }}
@lang('Updated') {{ $offer->updated_at->diffForHumans() }}. {{ $visibilityText }} {{ $readinessText }}
@empty
@lang('No trade ads yet')

@lang('Create your first buy or sell ad to start receiving trade requests in the marketplace.')

@endforelse
@if($offers->hasPages()) {{ $offers->links() }} @endif
@endsection