@extends('layouts.app') @section('title', $employee->full_name) @section('breadcrumbs') @endsection @section('content')
@if(session('new_employee_credentials')) @php $creds = session('new_employee_credentials'); @endphp

One-time login credentials

{{ $creds['email_sent'] ? 'These credentials were emailed to the employee. This is the only time the password will be shown — copy it now if you need a backup.' : 'Email delivery failed. Share these credentials with the employee manually — this is the only time the password will be shown.' }}

Email
{{ $creds['email'] }}
Temporary password
{{ $creds['password'] }}
·
@endif {{-- Header --}}
@if($employee->profile_photo) {{ $employee->full_name }} @else
{{ $employee->initials }}
@endif

{{ $employee->full_name }}

{{ $employee->status_label }}

{{ $employee->designation?->name ?? '—' }} · {{ $employee->department?->name ?? '—' }}

{{ $employee->employee_code }} · {{ $employee->user?->email }}

@role('company_admin')
Edit Profile
@endrole
{{-- Tabs --}}
{{-- Personal Tab --}}
@php $fields = [ 'Full Name' => $employee->full_name, 'Employee Code' => $employee->employee_code, 'Email' => $employee->user?->email, 'Phone' => $employee->user?->phone ?? '—', 'Date of Birth' => $employee->date_of_birth?->format('d M Y') ?? '—', 'Gender' => $employee->gender ? ucfirst($employee->gender) : '—', 'Nationality' => $employee->nationality ?? '—', 'National ID' => $employee->national_id ?? '—', 'Passport Number' => $employee->passport_number ?? '—', 'Marital Status' => $employee->marital_status ? ucfirst($employee->marital_status) : '—', ]; @endphp @foreach($fields as $label => $value)
{{ $label }}
{{ $value }}
@endforeach
{{-- Custom Fields --}} @if($customFields->isNotEmpty())

Additional Information

@foreach($customFields as $field)
{{ $field->field_label }}
{{ $customValues[$field->id] ?? '—' }}
@endforeach
@endif
{{-- Employment Tab --}}
@php $empFields = [ 'Department' => $employee->department?->name ?? '—', 'Designation' => $employee->designation?->name ?? '—', 'Reporting Manager' => $employee->reportingManager?->full_name ?? '—', 'Joining Date' => $employee->joining_date->format('d M Y'), 'Probation End' => $employee->probation_end_date?->format('d M Y') ?? '—', 'Contract Type' => ucfirst($employee->contract_type), 'Contract End' => $employee->contract_end_date?->format('d M Y') ?? '—', 'Work Location' => $employee->work_location ?? '—', 'Status' => $employee->status_label, ]; @endphp @foreach($empFields as $label => $value)
{{ $label }}
@if($label === 'Status') {{ $value }} @else {{ $value }} @endif
@endforeach
{{-- Documents Tab --}}
@role('company_admin')
@endrole
@if($employee->documents->count() > 0)
@foreach($employee->documents as $doc) @endforeach
Type Number Issued Expiry Status Verified Actions
{{ $doc->document_type }} {{ $doc->document_number ?? '—' }} {{ $doc->issue_date?->format('d/m/Y') ?? '—' }} {{ $doc->expiry_date?->format('d/m/Y') ?? '—' }} {{ $doc->expiry_label }} @if($doc->is_verified) Verified @else Unverified @endif
@role('company_admin') @if(!$doc->is_verified)
@csrf
@endif
@csrf @method('DELETE')
@endrole
@else
No documents uploaded
Upload employee documents like passport, visa, and contracts.
@endif
{{-- Banking Tab --}}
@role('company_admin')
@if($employee->bankDetails->count() > 0)
@foreach($employee->bankDetails as $bank)

{{ $bank->bank_name }}

@if($bank->is_primary) Primary @endif
Branch
{{ $bank->branch_name ?? '—' }}
Account
{{ $bank->account_number }}
IBAN
{{ $bank->iban ?? '—' }}
SWIFT
{{ $bank->swift_code ?? '—' }}
Bank Code
{{ $bank->bank_code ?? '—' }}
@csrf @method('DELETE')
@endforeach
@else
No bank details
Add bank account information for payroll processing.
@endif @endrole
{{-- Emergency Contacts Tab --}}
@role('company_admin')
@endrole @if($employee->emergencyContacts->count() > 0)
@foreach($employee->emergencyContacts as $contact)

{{ $contact->name }}

@if($contact->is_primary) Primary @endif

{{ $contact->relationship }}

Phone:
{{ $contact->phone }}
@if($contact->email)
Email:
{{ $contact->email }}
@endif @if($contact->address)
Address:
{{ $contact->address }}
@endif
@role('company_admin')
@csrf @method('DELETE')
@endrole
@endforeach
@else
No emergency contacts
Add emergency contact information for this employee.
@endif
{{-- Activity Tab --}}
@if($activities->count() > 0)
@foreach($activities as $activity)

{{ $activity->description }}

{{ $activity->created_at->diffForHumans() }} · {{ $activity->created_at->format('d M Y, h:i A') }}

@endforeach
@else

No activity recorded yet.

@endif
{{-- Status Change Modal --}} @include('hr::employees._status-modal', ['employee' => $employee]) {{-- Document Upload Modal --}} {{-- Bank Detail Modal --}} {{-- Emergency Contact Modal --}}
@endsection