@extends('layouts.user') @section('title') {{ $market->name }} Marketplace @endsection @section('content') @php // NEXUS Session State for product grid $nexusActive = \App\Nexus\Engine\NexusConfig::isNexusActive(); $sessionOpen = false; $sessionEndTime = null; $nextSessionTime = null; $activeSessionName = null; $nextSessionName = null; $sessionNames = [1 => 'Dawn', 2 => 'Midday', 3 => 'Dusk']; $sessionTimes = [ 1 => (int) \App\Nexus\Engine\NexusConfig::get('session_1_start_utc'), 2 => (int) \App\Nexus\Engine\NexusConfig::get('session_2_start_utc'), 3 => (int) \App\Nexus\Engine\NexusConfig::get('session_3_start_utc'), ]; if ($nexusActive) { $sc = new \App\Nexus\Engine\SessionController(); $activeSession = $sc->getActiveSession(); $sessionOpen = ($activeSession !== null); if ($sessionOpen) { $activeSessionName = $sessionNames[$activeSession->session_number] ?? 'Session'; $durationMinutes = \App\Nexus\Engine\NexusConfig::getInt('session_duration_minutes', 60); $sessionEndTime = \Carbon\Carbon::parse($activeSession->actual_start) ->addMinutes($durationMinutes) ->toIso8601String(); } else { $nextSessionTime = $sc->getNextSessionTime()->toIso8601String(); $currentUtcHour = now()->utc()->hour; $nextNum = 1; foreach ($sessionTimes as $num => $hour) { if ($hour > $currentUtcHour) { $nextNum = $num; break; } } $nextSessionName = $sessionNames[$nextNum] ?? 'Session'; } } @endphp
{{ $market->name }}

{{ $market->name }} Marketplace

{{-- Session strip (NEXUS addition - hidden when inactive) --}} @if($nexusActive)
@if($sessionOpen) {{ $activeSessionName }} session active. Place your bids now. @else Next session: {{ $nextSessionName }}. Browse products anytime. @endif
--:--
@endif
{{-- ── Sidebar ── --}} {{-- ── Products ── --}}
{{-- Mobile tools (search + filter, hidden on desktop) --}}
@csrf
@foreach($markets as $m) {{ $m->name }} @endforeach
Products
@forelse($products as $p)
{{-- Image --}}
{{ $p->name }} {{-- Market badge --}} {{ $p->market->name }} {{-- View icon --}} {{-- Hover CTA --}}
@if($nexusActive && !$sessionOpen) Session Closed @else Place Bid → @endif
{{-- Info --}}
{{ $p->name }}
${{ number_format($p->value, 2) }} Auction ${{ number_format($p->old_value, 2) }}
@php $full = floor($p->rating); $half = ($p->rating - $full) >= 0.5; @endphp @for($i = 0; $i < $full; $i++) @endfor @if($half) @endif @for($i = 0; $i < (5 - $full - ($half ? 1 : 0)); $i++) @endfor {{ number_format($p->rating, 1) }}
@empty

No products found

Try a different search or browse another market.

@endforelse
{{-- Pagination --}} @if($products->hasPages())
{{ $products->links('pagination::tailwind') }}
@endif
@if($nexusActive) @endif @endsection