@include('frontend.partials.head', ['title' => 'Fily | Provider Lists'])
@include('frontend.dashboard.partials.styles')
@php
$providerName = $provider?->business_name ?: ($provider?->name ?: 'Provider');
$providerInitial = strtoupper(substr($providerName, 0, 1));
$tabs = [
'all' => ['label' => 'All', 'icon' => 'inventory_2'],
'pending' => ['label' => 'Pending', 'icon' => 'pending_actions'],
'rejected' => ['label' => 'Rejected', 'icon' => 'block'],
'accepted' => ['label' => 'Accepted', 'icon' => 'verified'],
];
$typeMeta = [
'job' => ['label' => 'Job', 'icon' => 'work'],
'rent' => ['label' => 'Rental', 'icon' => 'apartment'],
'hostel' => ['label' => 'Hostel', 'icon' => 'bed'],
'service' => ['label' => 'Service', 'icon' => 'construction'],
];
$statusMeta = [
'pending' => ['label' => 'Pending', 'class' => 'warning'],
'rejected' => ['label' => 'Rejected', 'class' => 'danger'],
'approved' => ['label' => 'Accepted', 'class' => 'success'],
];
$visibilityMeta = [
'visible' => ['label' => 'Visible', 'class' => 'success'],
'hidden' => ['label' => 'Hidden', 'class' => 'warning'],
'expired' => ['label' => 'Expired', 'class' => 'danger'],
];
@endphp
@include('frontend.partials.header')
@include('frontend.dashboard.provider.partials.hero', [
'provider' => $provider,
'kicker' => 'Provider listings',
'title' => 'Listings for '.$providerName,
'description' => 'Track every listing by moderation status and latest submission date.',
'actionUrl' => route('frontend.provider.add-list'),
'actionIcon' => 'add_business',
'actionLabel' => 'Add listing',
'status' => null,
])
@include('frontend.dashboard.provider.partials.sidebar', ['provider' => $provider, 'active' => 'lists'])
@if (session('status'))
{{ session('status') }}
@endif
Listing Status
{{ $listings->total() }} {{ Str::plural('listing', $listings->total()) }} in this view.
@foreach ($tabs as $key => $tab)
{{ $tab['label'] }}
{{ number_format((int) ($counts[$key] ?? 0)) }}
@endforeach
@forelse ($listings as $listing)
@php
$meta = $typeMeta[$listing->listing_type] ?? ['label' => ucfirst($listing->listing_type), 'icon' => 'inventory_2'];
$statusInfo = $statusMeta[$listing->status] ?? ['label' => ucfirst($listing->status), 'class' => 'warning'];
$visibility = $listing->visibility ?: 'visible';
$visibilityInfo = $visibilityMeta[$visibility] ?? $visibilityMeta['visible'];
$location = collect([$listing->location, $listing->city])->filter()->implode(', ');
$imageUrl = $listing->media_path ? asset('storage/'.$listing->media_path) : null;
$actionLabel = $listing->status === 'approved' ? 'View details' : 'Edit details';
@endphp
@if ($imageUrl)

@else
{{ $meta['icon'] }}
@endif
{{ $listing->title }}
{{ $location ?: 'Location not provided' }}
LST-{{ strtoupper($listing->listing_type) }}-{{ str_pad((string) $listing->id, 5, '0', STR_PAD_LEFT) }}
{{ $meta['icon'] }}{{ $meta['label'] }}
{{ $statusInfo['label'] }}
{{ $listing->price ? 'Rs '.number_format((float) $listing->price, 2) : 'No price' }}
{{ \Illuminate\Support\Carbon::parse($listing->created_at)->format('d M Y') }} · {{ $visibilityInfo['label'] }}
@empty
inventory_2
No listings found
Listings matching this status will appear here.
Add listing
@endforelse
@if ($listings->hasPages())
@endif
@include('frontend.partials.footer')