@extends('app::layouts.app') @section('title', 'İlanlarım') @section('content')
@include('panel.partials.sidebar', ['activeMenu' => 'listings'])
@forelse($listings as $listing) @php $listingImage = $listing->getFirstMediaUrl('listing-images'); $priceLabel = !is_null($listing->price) ? number_format((float) $listing->price, 2, ',', '.').' '.($listing->currency ?? 'TL') : 'Ücretsiz'; $statusLabel = $listing->statusLabel(); $statusBadgeClass = match ($listing->statusValue()) { 'sold' => 'bg-emerald-100 text-emerald-700', 'expired' => 'bg-rose-100 text-rose-700', 'pending' => 'bg-amber-100 text-amber-700', default => 'bg-blue-100 text-blue-700', }; $favoriteCount = (int) ($listing->favorited_by_users_count ?? 0); $viewCount = (int) ($listing->view_count ?? 0); $expiresAt = $listing->expires_at?->format('d/m/Y'); $videoCount = (int) ($listing->videos_count ?? 0); $readyVideoCount = (int) ($listing->ready_videos_count ?? 0); $pendingVideoCount = (int) ($listing->pending_videos_count ?? 0); @endphp

{{ $priceLabel }}

{{ $statusLabel }}

{{ $listing->title }}

İşlemler
İlanı Düzenle
@csrf
@if($listing->statusValue() !== 'sold')
@csrf
@endif @if($listing->statusValue() === 'expired')
@csrf
@endif
👁 {{ $viewCount }}
{{ $favoriteCount }}

Yayın Tarihi & Bitiş Tarihi: {{ $listing->created_at?->format('d/m/Y') ?? '-' }} - {{ $expiresAt ?: '-' }}

@if($videoCount > 0)

Video Durumu: {{ $videoCount }} toplam, {{ $readyVideoCount }} hazır, {{ $pendingVideoCount }} işleniyor

@endif
@if((string) $listing->status === 'expired')
Bu ilanın süresi doldu. Eğer sattıysan, lütfen satıldı olarak işaretle.
@endif
@empty
Bu filtreye uygun ilan bulunamadı.
@endforelse
@if($listings->hasPages())
{{ $listings->links() }}
@endif
@endsection