@extends('app::layouts.app') @section('title', 'Favoriler') @section('content')
@include('panel.partials.sidebar', ['activeMenu' => 'favorites', 'activeFavoritesTab' => $activeTab])
@if($requiresLogin ?? false)

Favorites

Stay on this page and log in when you want to sync saved listings, searches, and sellers.

Log in
@endif @if($activeTab === 'listings') @php $listingTabQuery = array_filter([ 'tab' => 'listings', 'status' => $statusFilter, 'category' => $selectedCategoryId, 'message_filter' => $messageFilter, ], fn ($value) => !is_null($value) && $value !== ''); @endphp

Favori Listem

@forelse($favoriteListings as $listing) @php $listingImage = $listing->getFirstMediaUrl('listing-images'); $priceLabel = $listing->price ? number_format((float) $listing->price, 0).' '.$listing->currency : 'Ücretsiz'; $meta = collect([ $listing->category?->name, $listing->city, $listing->country, ])->filter()->join(' › '); $conversationId = $buyerConversationListingMap[$listing->id] ?? null; $isOwnListing = (int) $listing->user_id === (int) auth()->id(); $canMessageListing = !is_null($listing->user_id) && ! $isOwnListing; @endphp @empty @endforelse
İlan Başlığı Fiyat Mesajlaşma
@if($listingImage) {{ $listing->title }} @else
Görsel yok
@endif
{{ $listing->title }}

{{ $meta !== '' ? $meta : 'Kategori / konum bilgisi yok' }}

Favoriye eklenme: {{ $listing->pivot->created_at?->format('d.m.Y') }}

{{ $priceLabel }} @if($canMessageListing) @if($conversationId) Sohbete Git @else
@csrf @if($selectedCategoryId) @endif
@endif @else {{ $isOwnListing ? 'Kendi ilanın' : 'Satıcı bilgisi yok' }} @endif
@csrf
Henüz favori ilan bulunmuyor.
* Son 1 yıl içinde favoriye eklediğiniz ilanlar listelenmektedir.
@if($favoriteListings?->hasPages())
{{ $favoriteListings->links() }}
@endif

Gelen Kutusu

@forelse($conversations as $conversation) @php $conversationListing = $conversation->listing; $partner = (int) $conversation->buyer_id === (int) auth()->id() ? $conversation->seller : $conversation->buyer; $isSelected = $selectedConversation && (int) $selectedConversation->id === (int) $conversation->id; $conversationImage = $conversationListing?->getFirstMediaUrl('listing-images'); $lastMessage = trim((string) ($conversation->lastMessage?->body ?? '')); @endphp
@if($conversationImage) {{ $conversationListing?->title }} @else
İlan
@endif

{{ $partner?->name ?? 'Kullanıcı' }}

{{ $conversation->last_message_at?->format('d.m.Y') }}

{{ $conversationListing?->title ?? 'İlan silinmiş' }}

{{ $lastMessage !== '' ? $lastMessage : 'Henüz mesaj yok' }}

@if($conversation->unread_count > 0) {{ $conversation->unread_count }} @endif
@empty
Henüz bir sohbetin yok.
@endforelse
@if($selectedConversation) @php $activeListing = $selectedConversation->listing; $activePartner = (int) $selectedConversation->buyer_id === (int) auth()->id() ? $selectedConversation->seller : $selectedConversation->buyer; $activePriceLabel = $activeListing && !is_null($activeListing->price) ? number_format((float) $activeListing->price, 0).' '.($activeListing->currency ?? 'TL') : null; @endphp
{{ strtoupper(substr((string) ($activePartner?->name ?? 'K'), 0, 1)) }}

{{ $activePartner?->name ?? 'Kullanıcı' }}

{{ $activeListing?->title ?? 'İlan silinmiş' }}

@if($activePriceLabel)
{{ $activePriceLabel }}
@endif
@forelse($selectedConversation->messages as $message) @php $isMine = (int) $message->sender_id === (int) auth()->id(); @endphp
{{ $message->body }}

{{ $message->created_at?->format('H:i') }}

@empty

Henüz mesaj yok.

Aşağıdaki hazır metinlerden birini seçebilir veya yeni mesaj yazabilirsin.

@endforelse
@foreach($quickMessages as $quickMessage)
@csrf @if($selectedCategoryId) @endif
@endforeach
@csrf @if($selectedCategoryId) @endif
@error('message')

{{ $message }}

@enderror
@else

Mesajlaşma için bir sohbet seç.

İlan detayından veya favori ilan satırındaki "Mesaj Gönder" butonundan yeni sohbet başlatabilirsin.

@endif
@endif @if($activeTab === 'searches')

Favori Aramalar

Kayıtlı aramalarına tek tıkla geri dön.

@forelse($favoriteSearches as $favoriteSearch) @php $searchUrl = route('listings.index', array_filter([ 'search' => $favoriteSearch->search_term, 'category' => $favoriteSearch->category_id, ])); @endphp

{{ $favoriteSearch->label ?: 'Kayıtlı arama' }}

@if($favoriteSearch->search_term) Arama: "{{ $favoriteSearch->search_term }}" · @endif @if($favoriteSearch->category) Kategori: {{ $favoriteSearch->category->name }} · @endif Kaydedilme: {{ $favoriteSearch->created_at?->format('d.m.Y H:i') }}

Aramayı Aç
@csrf @method('DELETE')
@empty
Henüz favori arama eklenmedi.
@endforelse
@if($favoriteSearches?->hasPages())
{{ $favoriteSearches->links() }}
@endif @endif @if($activeTab === 'sellers')

Favori Satıcılar

Takip etmek istediğin satıcıları burada yönetebilirsin.

@forelse($favoriteSellers as $seller)
{{ strtoupper(substr((string) $seller->name, 0, 1)) }}

{{ $seller->name }}

{{ $seller->email }}

Aktif ilan: {{ (int) $seller->active_listings_count }}

@csrf
@empty
Henüz favori satıcı eklenmedi.
@endforelse
@if($favoriteSellers?->hasPages())
{{ $favoriteSellers->links() }}
@endif @endif
@endsection