@extends('frontend.layouts.user.index') @section('title', isset($offer) ? __('Manage Trade Ad') : __('Create Trade Ad')) @section('content') @php $isEditing = isset($offer); $offerPaymentMethodIds = $isEditing ? $offer->paymentMethods->pluck('id')->map(fn ($id) => (int) $id)->all() : []; $managePromotion = $isEditing ? $offer->promotion : null; $isManagePromoted = $managePromotion && $managePromotion->status === \App\Enums\P2P\PromotionStatus::ACTIVE && $managePromotion->ends_at && $managePromotion->ends_at->isFuture(); $manageDecimals = (int) setting('site_decimal', 2); $manageCurrency = $isEditing ? ($offer->wallet->currency->code ?? siteCurrency('code')) : siteCurrency('code'); $manageFiatCurrency = siteCurrency('code') ?: $manageCurrency; $managePriceText = $isEditing ? number_format((float) $offer->price, $manageDecimals) . ' ' . $manageFiatCurrency : null; $manageLimitText = $isEditing ? number_format((float) $offer->min_amount, $manageDecimals) . ' - ' . ($offer->max_amount !== null ? number_format((float) $offer->max_amount, $manageDecimals) : __('∞')) : null; $managePaymentMethodsCount = $isEditing ? $offer->paymentMethods->count() : 0; $manageCanEditTradeAd = ! $isEditing || ($canEditTradeAd ?? false); $manageCanManageLifecycle = $isEditing && ($canManageLifecycle ?? false); $manageCanDelete = $isEditing && (int) ($openOrders ?? 0) === 0; @endphp {{-- Trade Ad Builder: wallet, pricing, payment methods, terms, and optional promotion plan --}}
@lang('Use this page to update ad details, review trade health, and handle lifecycle actions from one place.')