{{-- Ratings Box Component --}} {{-- Required variables: - $offer: The offer object to get ratings for --}} @php // جلب تقييم صاحب المشروع للمستقل $ownerToFreelancerRating = \App\Models\Rating::where('offer_id', $offer->id) ->where('rating_type', \App\Models\Rating::TYPE_OWNER_TO_FREELANCER) ->first(); // جلب تقييم المستقل لصاحب المشروع $freelancerToOwnerRating = \App\Models\Rating::where('offer_id', $offer->id) ->where('rating_type', \App\Models\Rating::TYPE_FREELANCER_TO_OWNER) ->first(); $projectShareUrl = route('project.details', [$offer->project->id, createProjectSlug($offer->project->title)]); @endphp @if($ownerToFreelancerRating || $freelancerToOwnerRating)

تقيمات المشروع

{{-- تقييم صاحب المشروع للمستقل --}} @if($ownerToFreelancerRating)
{{-- User Info at Top --}}
{{-- Rating Stars --}}
@for($i = 1; $i <= 5; $i++) @endfor ({{ $ownerToFreelancerRating->rating }}/5)
{{-- Comment --}} @if($ownerToFreelancerRating->comment)

{{ $ownerToFreelancerRating->comment }}

@endif {{-- Share Rating --}} @include('front.project._rating_share_modal', [ 'modalId' => 'shareRatingModalOwnerToFreelancer', 'projectShareUrl' => $projectShareUrl, 'rating' => $ownerToFreelancerRating->rating, 'comment' => $ownerToFreelancerRating->comment, 'freelancerName' => $ownerToFreelancerRating->ratedUser->name ?? 'المستقل', 'projectTitle' => $offer->project->title ?? '', ])
@endif {{-- تقييم المستقل لصاحب المشروع --}} @if($freelancerToOwnerRating)
{{-- User Info at Top --}}
{{ $freelancerToOwnerRating->ratedBy->name ?? 'المستقل' }}
{{-- Rating Stars --}}
@for($i = 1; $i <= 5; $i++) @endfor ({{ $freelancerToOwnerRating->rating }}/5)
{{-- Comment --}} @if($freelancerToOwnerRating->comment)

{{ $freelancerToOwnerRating->comment }}

@endif {{-- Share Rating --}} @include('front.project._rating_share_modal', [ 'modalId' => 'shareRatingModalFreelancerToOwner', 'projectShareUrl' => $projectShareUrl, 'rating' => $freelancerToOwnerRating->rating, 'comment' => $freelancerToOwnerRating->comment, 'freelancerName' => $freelancerToOwnerRating->ratedBy->name ?? 'المستقل', 'projectTitle' => $offer->project->title ?? '', ])
@endif
@endif