@extends('layouts.admin') @section('title', 'User • ' . ($user->name ?? $user->email)) @php use Illuminate\Support\Facades\Route as RouteFacade; use Carbon\Carbon; function formatDate($date, $format = 'M d, Y H:i') { if (!$date) return 'N/A'; try { return is_string($date) ? Carbon::parse($date)->format($format) : $date->format($format); } catch (\Throwable $e) { return 'Invalid Date'; } } // Where inline edits post $inlineUrl = RouteFacade::has('admin.users.inline') ? route('admin.users.inline', $user) : url("/admin/users/{$user->id}/inline"); // Enums from schema $statusEnum = ['potential','active','suspended','inactive','pending']; $accessTypeEnum = ['premium','freemium','trial','basic','free']; $paymentMethodEnum = ['free','credit_card','telco_billing','school_billing','tuition_billing']; // Status badge $statusLower = strtolower($user->status ?? 'unknown'); $statusBadgeClass = match($statusLower) { 'active' => 'bg-success', 'suspended' => 'bg-danger', 'inactive' => 'bg-secondary', 'pending' => 'bg-warning', 'potential' => 'bg-info', default => 'bg-secondary', }; // helper: route if exists else fallback URL $routeOr = function(string $name, $param, string $fallback) { return RouteFacade::has($name) ? route($name, $param) : url($fallback); }; @endphp @section('content')
User Profile & Management
Maxile Level
Game Level
Tests Completed
Quizzes Completed
| ID | Completed | Result | Attempts | Kudos | Date |
|---|---|---|---|---|---|
| {{ $test->id }} | {{ $test->pivot->test_completed ? 'Yes' : 'No' }} | {{ $test->pivot->result ?? 'N/A' }} | {{ $test->pivot->attempts ?? 0 }} | {{ $test->pivot->kudos ?? 0 }} | {{ formatDate($test->pivot->completed_date, 'M d, Y') }} |
| No tests found | |||||
| ID | Completed | Result | Attempts | Date |
|---|---|---|---|---|
| id}") }}">{{ $quiz->id }} | {{ $quiz->pivot->quiz_completed ? 'Yes' : 'No' }} | {{ $quiz->pivot->result ?? 'N/A' }} | {{ $quiz->pivot->attempts ?? 0 }} | {{ formatDate($quiz->pivot->completed_date, 'M d, Y') }} |
| No quizzes found | ||||
| ID | Answered | Correct | Attempts | Difficulty | Kudos | Type | Test | Quiz | Date |
|---|---|---|---|---|---|---|---|---|---|
| id}") }}">{{ $q->id }} | {{ $q->pivot->question_answered ? 'Yes' : 'No' }} | {{ $q->pivot->correct ? '✓' : '✗' }} | {{ $q->pivot->attempts }} | {{ $q->difficulty->difficulty}} | {{ $q->pivot->kudos }} | {{ $q->pivot->assessment_type ?: 'N/A' }} | @if($q->pivot->test_id) {{ $q->pivot->test_id }} @else N/A @endif | @if($q->pivot->quiz_id) pivot->quiz_id}") }}">{{ $q->pivot->quiz_id }} @else N/A @endif | {{ formatDate($q->pivot->answered_date, 'M d, Y') }} |
| No questions found | |||||||||
| Track | Maxile | Passed | Doneness | Test Date |
|---|---|---|---|---|
| id}") }}"> {{ $track->track }} | {{ number_format($track->pivot->track_maxile, 2) }} | {!! $track->pivot->track_passed ? 'Yes' : 'No' !!} | {{ number_format($track->pivot->doneNess, 2) }}% | {{ formatDate($track->pivot->track_test_date) }} |
| No track attempts | ||||
| Skill | Maxile | Passed | Difficulty | Tries | Correct Streak | Total Correct | Total Incorrect | Fail Streak | Test Date |
|---|---|---|---|---|---|---|---|---|---|
| id}") }}">{{ $skill->skill }} | {{ number_format($skill->pivot->skill_maxile, 2) }} | {!! $skill->pivot->skill_passed ? 'Yes' : 'No' !!} | {{ $skill->pivot->difficulty_passed }} | {{ $skill->pivot->noOfTries }} | {{ $skill->pivot->correct_streak }} | {{ $skill->pivot->total_correct_attempts }} | {{ $skill->pivot->total_incorrect_attempts }} | {{ $skill->pivot->fail_streak }} | {{ formatDate($skill->pivot->skill_test_date) }} |
| No skill attempts | |||||||||
Showing first 50 of {{ $user->skill_user->count() }}
@endif| Field | Field Maxile | Month Achieved | Test Date |
|---|---|---|---|
| id}") }}">{{ $field->field }} | {{ number_format($field->pivot->field_maxile, 2) }} | {{ $field->pivot->month_achieved }} | {{ formatDate($field->pivot->field_test_date) }} |
| House | Role | Plan | Progress | Start | Expiry | Payment | Amount |
|---|---|---|---|---|---|---|---|
| @php $houseId = $en->house->id ?? $en->pivot->house_id; $houseName = $en->house->name ?? ('House #'.$houseId); @endphp {{ $houseName }} | @php $roleId = $en->role->id ?? $en->pivot->role_id; $roleName = $en->role->role ?? ('Role #'.$roleId); @endphp {{ $roleName }} | {{ $en->pivot->plan_id ?: '—' }} | {{ (int)$en->pivot->progress }}% | {{ formatDate($en->pivot->start_date, 'M d, Y') }} | {{ formatDate($en->pivot->expiry_date, 'M d, Y') }} | {{ $en->pivot->payment_status ?: '—' }} | @if(!is_null($en->pivot->amount_paid)) {{ number_format($en->pivot->amount_paid, 2) }} {{ $en->pivot->currency_code ?: '' }} @else — @endif |
| No enrolments found | |||||||
| Date | Action | Details |
|---|---|---|
| {{ formatDate($log->created_at, 'M d H:i') }} | {{ $log->action ?? 'Unknown' }} | {{ $log->details ?? 'No details' }} |
| No logs found | ||