@extends('layouts.user') @section('title', 'Professional Documents') @section('content') @php // Fetch professional documents from all user profiles $professionalDocs = \App\Models\PortalUserProfileDoc::whereHas('profile', function($q) use ($user) { $q->where('user_id', $user->id); })->with(['profile.roleProfile', 'profile.beltType', 'profile.belt'])->get(); // Helper function to extract clean file name from path function extractFileName($path) { if (empty($path)) return 'N/A'; // Extract just the filename from the full path $filename = basename($path); // Remove common prefixes like timestamps or user IDs $filename = preg_replace('/^\d+_/', '', $filename); // Replace underscores with spaces and capitalize $filename = str_replace('_', ' ', $filename); $filename = ucwords($filename); return $filename; } // Helper function to get role badge color function getRoleBadgeColor($roleName) { $colors = [ 'Athlete' => 'primary', 'Coach' => 'success', 'Referee' => 'warning', 'Doctor' => 'danger', 'Physiotherapist' => 'info', 'Manager' => 'secondary', 'Media' => 'dark', 'Official' => 'primary' ]; return $colors[$roleName] ?? 'secondary'; } $totalDocs = $professionalDocs->count(); $totalBeltCerts = $professionalDocs->filter(fn($d) => !empty($d->belt_certificate_path))->count(); $totalSupportingDocs = $professionalDocs->filter(fn($d) => !empty($d->supporting_doc_path))->count(); @endphp

Professional Documents

Manage your belt certificates and professional credentials
Total Profiles

{{ $totalDocs }}

Belt Certificates

{{ $totalBeltCerts }}

Supporting Documents

{{ $totalSupportingDocs }}

@if($totalDocs > 0)
@foreach($professionalDocs as $doc) @php $profile = $doc->profile; $roleName = optional($profile->roleProfile)->name ?? 'N/A'; $beltType = optional($profile->beltType)->name ?? 'N/A'; $belt = optional($profile->belt)->name ?? 'N/A'; $licenseLevel = $profile->license_level ?? null; @endphp
{{ $roleName }}
Profile #{{ $profile->id }}
Belt Type: {{ $beltType }}
@if($beltType !== 'N/A')
Belt/Grade: {{ $belt }}
@endif @if($licenseLevel && $roleName === 'Coach')
License Level: Level {{ $licenseLevel }}
@endif
Belt Certificate: @if(!empty($doc->belt_certificate_path)) Uploaded @else Pending @endif
@if(!empty($doc->belt_certificate_path))

{{ extractFileName($doc->belt_certificate_path) }}

@endif
@if(!empty($doc->supporting_doc_path))
Supporting Document: Uploaded

{{ extractFileName($doc->supporting_doc_path) }}

@endif
@endforeach
@else
No Professional Documents Found

Professional documents are added automatically when you apply for roles with belt requirements or coaching certifications.

@endif
@endsection