@extends('layouts.app') @section('content') @php $authUser = auth()->user(); $canViewBooking = $authUser && $authUser->hasPermission('bookings', 'view'); $canEditMedia = $authUser && $authUser->hasPermission('booking_media', 'edit'); @endphp
@if(session('success')) @endif @if(session('error')) @endif
Rating Summary
@if($rating->status === 'approved') Approved @elseif($rating->status === 'reject') Rejected @else Pending Approval @endif
@for($i = 1; $i <= 5; $i++) @if($i <= $rating->rating) @else @endif @endfor

{{ $rating->rating }} / 5 Stars

Submitted on {{ $rating->created_at ? $rating->created_at->format('d M Y, h:i A') : 'N/A' }}

{{ $rating->review ?: 'No written feedback provided.' }}

  • Booking No: @if($rating->booking) @if($canViewBooking) #{{ $rating->booking->booking_no }} @else #{{ $rating->booking->booking_no }} @endif @else N/A @endif
  • Booking Status: {{ ucfirst($rating->booking?->status ?? 'completed') }}
  • Customer (Rated By): {{ $rating->fromUser?->name ?? 'N/A' }}
  • Partner (Rated To): {{ $rating->toUser?->name ?? 'N/A' }}
  • @php $rewardAmount = round((float) (function_exists('setting') ? setting('booking_media_reward_amount', 0) : 0), 2); $hasVideo = (bool) $rating->video; @endphp @if($hasVideo)
  • Video Cashback: @if($rating->status === 'approved') ₹{{ number_format($rewardAmount, 2) }} Credited @elseif($rating->status === 'reject') No Cashback (Rejected) @else ₹{{ number_format($rewardAmount, 2) }} (On Approval) @endif
  • @endif
@if($rating->status === 'pending' && $canEditMedia)
@elseif($rating->status === 'pending')
View-Only Access

You do not have permission to approve or reject ratings.

@elseif($rating->status === 'approved')
Action Completed: Approved

This rating has already been approved. Further action cannot be taken.

@elseif($rating->status === 'reject')
Action Completed: Rejected

This rating has already been rejected. Further action cannot be taken.

@endif
Review Video
@if($rating->video) Playable Video @endif
@if($rating->video) @php $videoUrl = route('admin.booking-ratings.video', $rating->id); $rawVideoUrl = $rating->video['url'] ?? ''; $videoRelUrl = parse_url($rawVideoUrl, PHP_URL_PATH) ?: $rawVideoUrl; $mimeType = $rating->video['mime_type'] ?? 'video/mp4'; @endphp
{{ $rating->video['file_name'] }} Size: {{ round(($rating->video['size'] ?? 0) / 1024 / 1024, 2) }} MB
Download Video
@else
No video attached with this rating.
@endif
@if(!empty($rating->photos))
Attached Photos ({{ count($rating->photos) }})
@foreach($rating->photos as $p)
Photo
{{ $p['file_name'] }}
@endforeach
@endif
@if($rating->status === 'pending' && $canEditMedia) @endif @endsection