{{-- resources/views/restaurant-detail.blade.php --}} {{ $restaurant->name }} - Order Online | {{ $appName ?? config('app.name') }} @php $currencySymbol = App\Models\AppSetting::getValue('currency_symbol', '₹'); $currencyDecimals = App\Models\AppSetting::currencyDecimals(); @endphp @include('partials.public-blade-polish') @php // Safe banner URL with null checks $restaurantBannerUrl = 'https://images.unsplash.com/photo-1517248135467-4c7edcad34c4?w=1200&h=400&fit=crop'; if ($restaurant->banner_image) { $restaurantBannerUrl = \App\Services\MediaStorage::url($restaurant->banner_image); } elseif ($restaurant->cover_image) { $restaurantBannerUrl = \App\Services\MediaStorage::url($restaurant->cover_image); } // Safe logo URL $restaurantLogoUrl = null; if ($restaurant->logo_image) { $restaurantLogoUrl = \App\Services\MediaStorage::url($restaurant->logo_image); } // Safe weekly schedule handling $weekSchedule = $restaurant->weekly_schedule; $todayName = \Carbon\Carbon::now()->format('l'); $todaySchedule = (is_array($weekSchedule) && isset($weekSchedule[$todayName])) ? $weekSchedule[$todayName] : null; $openTimeLabel = null; $closeTimeLabel = null; if ($todaySchedule && is_array($todaySchedule)) { $openTimeLabel = isset($todaySchedule['open']) && $todaySchedule['open'] ? \Carbon\Carbon::parse($todaySchedule['open'])->format('h:i A') : null; $closeTimeLabel = isset($todaySchedule['close']) && $todaySchedule['close'] ? \Carbon\Carbon::parse($todaySchedule['close'])->format('h:i A') : null; } // Safe cuisine display $cuisineDisplay = !empty($restaurant->cuisine_names) ? implode(' • ', $restaurant->cuisine_names) : 'Various Cuisines'; // Safe rating $rating = $restaurant->rating ?? 4.5; $totalReviews = $restaurant->reviews_count ?? 0; // Restaurant hours display $openStatusText = $restaurant->is_open ? 'Open Now' : 'Closed'; $openStatusClass = $restaurant->is_open ? '#D1FAE5' : '#FEE2E2'; $openStatusTextClass = $restaurant->is_open ? '#065F46' : '#991B1B'; // Group menu items by category safely $menuItemsByCategory = collect(); if ($restaurant->menuItems && $restaurant->menuItems->count()) { $menuItemsByCategory = $restaurant->menuItems ->where('is_available', true) ->where('is_scheduled_available', true) ->groupBy(function($item) { return optional($item->category)->name ?? 'Uncategorized'; }); } @endphp
{{ $restaurant->name }}
@if($restaurantLogoUrl) @else @endif

{{ $restaurant->name }}

{{ $cuisineDisplay }}

{{ number_format($rating, 1) }} ({{ $totalReviews }}+ ratings)
@php $amountForOne = $restaurant->amountForOne(); @endphp @if($amountForOne !== null && $amountForOne > 0)
{{ $currencySymbol }}{{ number_format($amountForOne, App\Models\AppSetting::currencyDecimals()) }} for one
@endif
{{ $restaurant->delivery_time ?? '30-40' }} min
{{ $restaurant->city ?? 'Your City' }}
@if($restaurant->is_pure_veg)
Pure Veg
@endif
Calculating distance...
@if($restaurant->is_open)
Open Now
@else
Closed
@endif @if($openTimeLabel && $closeTimeLabel)
{{ $restaurant->is_open ? 'Open until '.$closeTimeLabel : 'Opens at '.$openTimeLabel }}
@elseif($openTimeLabel)
Opens at {{ $openTimeLabel }}
@elseif($closeTimeLabel)
Closes at {{ $closeTimeLabel }}
@endif
{{-- Delivery fee removed --}}
@if(!$restaurant->is_open)
Store is currently closed. @if($openTimeLabel && $closeTimeLabel) Orders can only be placed between {{ $openTimeLabel }} and {{ $closeTimeLabel }}. @elseif($openTimeLabel) Opens at {{ $openTimeLabel }}. @elseif($closeTimeLabel) Closes at {{ $closeTimeLabel }}. @else Orders can only be placed when the store reopens. @endif
@endif @if(!empty($activePromos) && $activePromos->isNotEmpty())
Offers For You
Tap a code at checkout to unlock savings
{{ $activePromos->count() }} live
@foreach($activePromos as $promo)
{{ $promo->discount_type === 'percentage' ? rtrim(rtrim($promo->discount_value, '0'), '.') . '% OFF' : $currencySymbol . number_format((float) $promo->discount_value, $currencyDecimals) . ' OFF' }}
{{ $promo->title ?: 'Special store offer' }}

{{ \Illuminate\Support\Str::limit($promo->description ?: 'Apply this code during checkout and save on your order.', 78) }}

@if((float) $promo->min_order_amount > 0) Min {{ $currencySymbol }}{{ number_format((float) $promo->min_order_amount, $currencyDecimals) }} @endif @if($promo->end_date) Ends {{ \Carbon\Carbon::parse($promo->end_date)->format('M j') }} @endif
{{ $promo->code }}
@endforeach
@endif @if(!empty($weekSchedule) && is_array($weekSchedule) && count($weekSchedule))
Weekly Kitchen Hours
@foreach($weekSchedule as $day => $hours)
{{ $day }} @if(is_array($hours) && isset($hours['open']) && isset($hours['close']) && $hours['open'] && $hours['close']) {{ \Carbon\Carbon::parse($hours['open'])->format('h:i A') }} - {{ \Carbon\Carbon::parse($hours['close'])->format('h:i A') }} @else Closed @endif
@endforeach
@endif
{{ number_format($rating, 1) }}
@for($i = 1; $i <= 5; $i++) @endfor
{{ $totalReviews }} ratings
@php $ratingBreakdown = $restaurant->rating_breakdown ?? [5 => 0, 4 => 0, 3 => 0, 2 => 0, 1 => 0]; $maxRating = max(array_sum($ratingBreakdown), 1); @endphp @foreach([5,4,3,2,1] as $star)
{{ $star }}★
{{ $ratingBreakdown[$star] ?? 0 }}
@endforeach
Customer Reviews
@if($restaurant->reviews && $restaurant->reviews->count()) @foreach($restaurant->reviews->take(5) as $review)
{{ substr($review->user->name ?? 'U', 0, 1) }}
{{ $review->user->name ?? 'Anonymous User' }}
@for($i = 1; $i <= 5; $i++) @endfor
{{ $review->created_at->diffForHumans() ?? '' }}

{{ $review->comment ?? 'No comment provided.' }}

@endforeach @else

No reviews yet

@endif
About this store

{{ $restaurant->description ?? 'We serve authentic and delicious food made with fresh ingredients. Our store is committed to providing the best dining experience with quality food and excellent service.' }}

Contact Information
{{ $restaurant->phone ?? 'N/A' }}
{{ $restaurant->email ?? 'N/A' }}
{{ $restaurant->address ?? 'Address not available' }} @if($restaurant->city || $restaurant->state) , {{ $restaurant->city ?? '' }} {{ $restaurant->state ?? '' }} - {{ $restaurant->pincode ?? '' }} @endif
@forelse($similarRestaurants ?? [] as $similar)
@php $similarImage = $similar->logo_image ? \App\Services\MediaStorage::url($similar->logo_image) : 'https://images.unsplash.com/photo-1517248135467-4c7edcad34c4?w=300&h=160&fit=crop'; $similarCuisine = !empty($similar->cuisine_names) ? implode(', ', array_slice($similar->cuisine_names, 0, 3)) : 'Various'; @endphp {{ $similar->name }}
{{ $similar->name }}
{{ number_format($similar->rating ?? 4.5, 1) }} {{ $similar->delivery_time ?? '30' }} min
{{ $similarCuisine }}
@empty

No similar stores found

@endforelse
Your Cart

Your cart is empty

@include('partials.web-visit-tracker', ['panel' => 'frontend'])