@extends('layouts.public-profile') @section('title', $user->name.' - '.config('app.name', 'Laravel')) @section('content') @php $isFlatAccount = $user instanceof \App\Models\Student || $user instanceof \Modules\Mentors\Models\Mentor; $profile = $isFlatAccount ? (object) [ 'gender' => $user->gender, 'date_of_birth' => $user->date_of_birth, 'mobile_number' => $user->mobile_number, 'father_name' => $user->father_name, 'mother_name' => $user->mother_name, 'bio' => $user->bio, 'public_url' => $user->public_url, ] : $user->profile; $address = $isFlatAccount ? (object) [ 'house_number' => $user->house_number, 'street' => $user->street, 'city' => $user->city, 'post_office' => $user->post_office, 'zip_code' => $user->zip_code, 'country' => $user->country, ] : $user->address; if ($isFlatAccount && ! collect((array) $address)->filter()->count()) { $address = null; } $skills = $isFlatAccount ? collect($user->skills ?? [])->map(fn ($skill) => (object) [ 'name' => data_get($skill, 'name'), 'proficiency_level' => data_get($skill, 'proficiency_level'), ]) : $user->skills; $educations = $isFlatAccount ? collect($user->educations ?? [])->map(fn ($edu) => (object) $edu) : $user->educations; $experiences = $isFlatAccount ? collect($user->experiences ?? [])->map(fn ($exp) => (object) array_merge((array) $exp, [ 'start_date' => data_get($exp, 'start_date') ? \Illuminate\Support\Carbon::parse(data_get($exp, 'start_date')) : null, 'end_date' => data_get($exp, 'end_date') ? \Illuminate\Support\Carbon::parse(data_get($exp, 'end_date')) : null, ])) : $user->experiences; $genderLabel = match ($profile?->gender) { 'male' => 'Male', 'female' => 'Female', 'other' => 'Other', default => null, }; $proficiencyLabel = [ 'beginner' => 'Beginner', 'intermediate' => 'Intermediate', 'expert' => 'Expert', ]; $proficiencyWidth = [ 'beginner' => 35, 'intermediate' => 70, 'expert' => 100, ]; $locationLine = $address ? trim(implode(', ', array_filter([$address->city, $address->country]))) : null; @endphp
@if ($user->profile_image) {{ $user->name }} @else
{{ strtoupper(substr($user->name, 0, 1)) }}
@endif

{{ $user->name }}

{{ __('Online CV / Portfolio') }}

@if ($genderLabel) {{ $genderLabel }} @endif @if ($profile?->date_of_birth) {{ $profile->date_of_birth->format('d M Y') }} @endif @if ($locationLine) {{ $locationLine }} @endif {{ __('Member since') }} {{ $user->created_at?->format('M Y') }}
{{ __('Email') }} @if ($profile?->mobile_number) {{ __('Call') }} @endif @if ($profile?->public_url) {{ __('Share link') }} @endif
@if ($profile?->bio)

{{ $profile->bio }}

@else

{{ __('No bio provided yet.') }}

@endif

{{ __('Skills') }}

{{ __('Level') }}
@if ($skills && $skills->count())
@foreach ($skills as $skill) @php $level = $skill->proficiency_level ?? $skill->pivot?->proficiency_level; $pct = $level ? ($proficiencyWidth[$level] ?? 0) : 0; @endphp
{{ $skill->name }}
{{ $level ? ($proficiencyLabel[$level] ?? $level) : '—' }}
@endforeach
@else

{{ __('No skills added yet.') }}

@endif

{{ __('Education') }}

@if ($educations && $educations->count())
    @foreach ($educations as $edu)
  1. {{ $edu->degree_name }}
    {{ $edu->institute_name }}
    @if ($edu->board_or_university)
    {{ __('Board/University') }}: {{ $edu->board_or_university }}
    @endif
    @if ($edu->start_year || $edu->end_year)
    @if ($edu->start_year) {{ $edu->start_year }} @endif @if ($edu->start_year && $edu->end_year) - @endif @if ($edu->end_year) {{ $edu->end_year }} @endif
    @endif @if ($edu->result_or_grade)
    {{ __('Result') }}: {{ $edu->result_or_grade }}
    @endif
  2. @endforeach
@else

{{ __('No education information provided yet.') }}

@endif

{{ __('Experience') }}

@if ($experiences && $experiences->count())
    @foreach ($experiences as $exp)
  1. {{ $exp->job_title }}
    {{ $exp->company_name }}
    @if ($exp->description)

    {{ $exp->description }}

    @endif
    {{ $exp->start_date?->format('M Y') }} @if ($exp->end_date) - {{ $exp->end_date->format('M Y') }} @else - {{ __('Present') }} @endif
  2. @endforeach
@else

{{ __('No experience information provided yet.') }}

@endif
@endsection