@extends('admin.layouts.app') @section('title', 'Ratings Management') @section('content')

Ratings & Reviews

Manage employer ratings from healthcare workers

Export CSV
@if(session('success'))
{{ session('success') }}
@endif
@include('admin.components.stat_card', ['label' => 'Total Ratings', 'value' => $stats['total'], 'icon' => 'fa-solid fa-star', 'color' => 'slate']) @include('admin.components.stat_card', ['label' => 'Verified', 'value' => $stats['verified'], 'icon' => 'fa-solid fa-badge-check', 'color' => 'emerald']) @include('admin.components.stat_card', ['label' => 'Recommended', 'value' => $stats['recommended'], 'icon' => 'fa-solid fa-thumbs-up', 'color' => 'blue']) @include('admin.components.stat_card', ['label' => 'Avg Overall', 'value' => $stats['avg_overall'], 'icon' => 'fa-solid fa-star-half-stroke', 'color' => 'amber']) @include('admin.components.stat_card', ['label' => 'Avg Fairness', 'value' => $stats['avg_fairness'], 'icon' => 'fa-solid fa-balance-scale', 'color' => 'purple']) @include('admin.components.stat_card', ['label' => 'Avg Comm.', 'value' => $stats['avg_communication'], 'icon' => 'fa-solid fa-comments', 'color' => 'indigo'])
Clear
@php $headers = [ ['label' => '', 'class' => 'w-12'], ['label' => 'Employer', 'class' => ''], ['label' => 'User', 'class' => ''], ['label' => 'Scores', 'class' => ''], ['label' => 'Status', 'class' => 'w-36'], ['label' => 'Date', 'class' => 'w-36'], ['label' => 'Actions', 'class' => 'text-right w-28'], ]; $rows = []; foreach($ratings as $rating) { $cells = []; $cells[] = ['content' => '', 'class' => '']; $employerHtml = ''; if($rating->employer?->logo_url) { $employerHtml = ''; } else { $employerHtml = '
'; } $cells[] = ['content' => '
' . $employerHtml . '

' . e($rating->employer?->company_name ?? 'Unknown') . '

', 'class' => '']; $cells[] = ['content' => '

' . e($rating->nurse?->name ?? 'Unknown') . '

' . e($rating->nurse?->email) . '

', 'class' => '']; $scoreHtml = '
Overall:
'; for($i = 1; $i <= 5; $i++) { if($i <= $rating->overall_score) { $scoreHtml .= ''; } else { $scoreHtml .= ''; } } $scoreHtml .= '' . $rating->overall_score . '/5
F:' . $rating->fairness_score . ' | C:' . $rating->communication_score . ' | Cond:' . $rating->conditions_score . ' | S:' . $rating->support_score . '
'; $cells[] = ['content' => $scoreHtml, 'class' => '']; $statusHtml = ''; if($rating->is_verified_interaction) { $statusHtml .= ' Verified'; } else { $statusHtml .= 'Unverified'; } if($rating->would_recommend) { $statusHtml .= ' Recommends'; } $cells[] = ['content' => '
' . $statusHtml . '
', 'class' => '']; $cells[] = ['content' => '
' . e($rating->created_at->format('M d, Y')) . '
', 'class' => '']; $actionHtml = '
'; $actionHtml .= '
' . csrf_field() . method_field('PATCH') . '
'; $actionHtml .= '
'; $cells[] = ['content' => $actionHtml, 'class' => 'text-right']; $rows[] = ['cells' => $cells]; } @endphp @include('admin.components.table_shell', [ 'headers' => $headers, 'rows' => $rows, 'emptyMessage' => 'No ratings found', 'pagination' => $ratings ]) @push('scripts') @endpush @endsection