@php $listingCollection = collect($listings ?? []); $providerName = $provider->business_name ?: ($provider->name ?: 'Provider'); $providerPhoto = $provider->profile_photo ? asset('storage/'.$provider->profile_photo) : null; $location = collect([$provider->city, $provider->state])->filter()->implode(', '); $ratingCount = $provider->reviews->count(); $ratingAverage = $ratingCount > 0 ? round((float) $provider->reviews->avg('rating'), 1) : null; $typeLabels = ['job' => 'Job', 'rent' => 'Rental', 'hostel' => 'Hostel', 'service' => 'Service']; $fallbackImages = [ 'job' => 'https://images.unsplash.com/photo-1556761175-b413da4baf72?auto=format&fit=crop&w=800&q=80', 'rent' => 'https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=800&q=80', 'hostel' => 'https://images.unsplash.com/photo-1555854877-bab0e564b8d5?auto=format&fit=crop&w=800&q=80', 'service' => 'https://images.unsplash.com/photo-1581578731548-c64695cc6952?auto=format&fit=crop&w=800&q=80', ]; $listingPrice = function ($listing): string { if ($listing->listing_type === 'job') { return $listing->price ? 'Rs. '.number_format((float) $listing->price).'/mo' : 'Hiring'; } if ($listing->listing_type === 'service') { return $listing->price ? 'Starts Rs. '.number_format((float) $listing->price) : 'On request'; } return $listing->price ? 'Rs. '.number_format((float) $listing->price).'/mo' : 'On request'; }; $listingImage = fn ($listing): string => $listing->media_path ? asset('storage/'.$listing->media_path) : ($fallbackImages[$listing->listing_type] ?? $fallbackImages['rent']); $listingMeta = fn ($listing): string => collect([$listing->location, $listing->city, $listing->meta_one])->filter()->take(3)->implode(' ยท ') ?: 'Details available on request'; @endphp @include('frontend.partials.head', ['title' => 'Fily | '.$providerName]) @include('frontend.partials.header')
{{-- arrow_backBack --}}
@if ($providerPhoto) {{ $providerName }} @else {{ strtoupper(substr($providerName, 0, 1)) }} @endif

{{ $provider->category?->name ?: 'Verified provider' }}

{{ $providerName }}

@if ($location)location_on{{ $location }}@endif verified{{ ucfirst($provider->status) }} star{{ $ratingAverage ? $ratingAverage.' rating' : 'No reviews yet' }}
@if ($provider->bio)

{{ $provider->bio }}

@endif
@if ($provider->whatsapp_number) forumWhatsApp @endif @if ($provider->contact_number) callCall @endif
{{ $listingCollection->count() }}

Approved ads

{{ $ratingAverage ?: '0' }}

Average rating

{{ $ratingCount }}

Reviews

Contact

{{ $provider->contact_number ?: $provider->mobile ?: 'On request' }}

WhatsApp

{{ $provider->whatsapp_number ?: 'On request' }}

Email

{{ $provider->email ?: 'On request' }}

GST

{{ $provider->gst_number ?: 'Not provided' }}

Website

{{ $provider->website ?: 'Not provided' }}

Address

{{ $provider->address ?: 'Not provided' }}

Provider listings

All approved ads by {{ $providerName }}

@forelse ($listingCollection as $listing) @empty
inventory_2

No approved listings

This provider does not have public approved ads right now.

@endforelse
@include('frontend.partials.footer')