@extends('backend.layouts.app') @section('title', __('Marketplace Settings')) @push('styles') @php $p2pAdminCssVersion = config('app.version').'-'.filemtime(public_path('backend/css/p2p-admin.css')); @endphp @endpush @php $enabled = (bool) old('enabled', $settings->enabled); $autoRelease = (bool) old('auto_release', $settings->auto_release); $commissionPct = old('commission_pct', $settings->commission_pct); $commissionFixed = old('commission_fixed', $settings->commission_fixed); $minOrder = old('min_order_amount', $settings->min_order_amount); $maxOrder = old('max_order_amount', $settings->max_order_amount); $holdMinutes = old('payout_hold_minutes', $settings->payout_hold_minutes); $commissionUid = old('commission_user_id', $settings->commission_user_id); $currencyCode = siteCurrency('code') ?? 'USD'; $updatedAgo = $settings->updated_at ? $settings->updated_at->diffForHumans() : __('never'); @endphp @section('content')

{{ __('Marketplace Settings') }}

@lang('Manage vendors')
{{-- ── Status hero (read-only) ── --}}
@lang('Vendor marketplace status')
{{ $settings->enabled ? __('Open · Accepting payments') : __('Paused') }} {{ $settings->enabled ? __('Live') : __('Offline') }}

@lang('The master switch lives in Feature Management as the') vendor_marketplace @lang('feature. The status toggle below is the day-to-day operational switch.')

@lang('Last updated') {{ $updatedAgo }} @lang('Default currency') {{ $currencyCode }}
{{-- ── Validation summary ── --}} @if($errors->any()) @endif
@csrf @method('PUT')
@lang('Commission & Payouts')

@lang('How each vendor payment is split between the vendor and the platform.')

{{-- ── Commission ── --}}
@lang('Commission')
@lang('Platform share of every marketplace order')
%
@lang('Percentage of the order kept by the platform. Vendors with an override use their own rate.') @error('commission_pct'){{ $message }}@enderror
{{ $currencyCode }}
@lang('Optional flat amount added on top of the percentage.') @error('commission_fixed'){{ $message }}@enderror
@lang('On an order of') {{ $currencyCode }}
@lang('Vendor receives') 0.00 {{ $currencyCode }} · @lang('Platform earns') 0.00 {{ $currencyCode }}
{{-- ── Order limits ── --}}
@lang('Order limits')
@lang('Smallest and largest single payment allowed')
{{ $currencyCode }}
@lang('Orders below this amount are rejected at checkout.') @error('min_order_amount'){{ $message }}@enderror
{{ $currencyCode }}
@lang('Leave blank for no upper limit. Must exceed the minimum.') @error('max_order_amount'){{ $message }}@enderror
{{-- ── Availability & payout flow ── --}}
@lang('Availability & payout')
@lang('Operational switch and vendor payout behaviour')
@error('enabled'){{ $message }}@enderror
@error('auto_release'){{ $message }}@enderror
@lang('min')
@lang('0 to 43,200 minutes (30 days). Used when payout mode is Hold.') @error('payout_hold_minutes'){{ $message }}@enderror
{{-- ── Commission account ── --}}
@lang('Commission account')
@lang('The wallet that collects the platform commission')
@if($commissionUser) {{ $commissionUser->name }} ({{ $commissionUser->email }}) @else @lang('Required before commission can be charged') @endif @error('commission_user_id'){{ $message }}@enderror
@lang('Accounting tip'): @lang('Commission lands in this user\'s wallet as a real, auditable balance. Refunds claw it back from the account that originally received it.')
{{-- ── Sticky save bar ── --}}
@lang('Changes apply to new orders immediately. Completed orders keep their original split.') @lang('Unsaved changes') @lang('Cancel')
@endsection @push('scripts') @endpush