@extends('app::layouts.app') @section('title', 'Favorites') @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, ], fn ($value) => !is_null($value) && $value !== ''); @endphp

Saved Listings

@forelse($favoriteListings as $listing) @php $listingImage = $listing->primaryImageData('card'); $priceLabel = $listing->price ? number_format((float) $listing->price, 0).' '.$listing->currency : 'Free'; $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
Listing Price Messaging
{{ $priceLabel }} @if($canMessageListing) @if($conversationId) Open chat @else
@csrf
@endif @else {{ $isOwnListing ? 'Your own listing' : 'Seller unavailable' }} @endif
@csrf
No saved listings yet.
* Listings saved within the last year are shown here.
@if($favoriteListings?->hasPages())
{{ $favoriteListings->links() }}
@endif @endif @if($activeTab === 'searches')

Saved Searches

Return to your saved searches with one click.

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

{{ $favoriteSearch->label ?: 'Saved search' }}

@if($favoriteSearch->search_term) Search: "{{ $favoriteSearch->search_term }}" · @endif @if($favoriteSearch->category) Category: {{ $favoriteSearch->category->name }} · @endif Saved: {{ $favoriteSearch->created_at?->format('M j, Y H:i') }}

Open search
@csrf @method('DELETE')
@empty
No saved searches yet.
@endforelse
@if($favoriteSearches?->hasPages())
{{ $favoriteSearches->links() }}
@endif @endif @if($activeTab === 'sellers')

Saved Sellers

Manage the sellers you want to follow here.

@if($favoriteSellers?->hasPages())
{{ $favoriteSellers->links() }}
@endif @endif
@endsection