@extends('layouts.app') @section('title', $employee->full_name.' · Employee 360') @section('content')
{{ strtoupper(substr($employee->first_name,0,1).substr($employee->last_name??'',0,1)) }}

{{ $employee->employee_code }}

{{ str_replace('_',' ',$employee->status) }}

{{ $employee->display_name ?: $employee->full_name }}

{{ $employee->designation ?: 'No designation' }} · {{ $employee->department?->name ?? 'No department' }} · {{ $employee->branch?->name ?? 'No branch' }}

Manager {{ $employee->reportingManager?->full_name ?? 'not assigned' }} · Joined {{ $employee->joining_date?->format('d M Y') ?? 'not recorded' }}

@if(auth()->check() && auth()->user()->hasPermission('attendance.manage'))Attendance@endif @if(auth()->check() && auth()->user()->hasPermission('leave.create'))Leave@endif @if(!$employee->user) @if(auth()->check() && auth()->user()->hasPermission('employees.edit'))Create user access@endif @elseManage access@endifDirectory

Contact

UAE mobile
{{ $employee->mobile ?: 'Not recorded' }}
Work email
{{ $employee->email ?: 'Not recorded' }}
Emergency
{{ $employee->emergency_contact_name ?: 'Not recorded' }} {{ $employee->emergency_contact_mobile }}

Employment

Type
{{ ucfirst(str_replace('_',' ',$employee->employment_type)) }}
Work location
{{ $employee->work_location ?: $employee->branch?->name }}
Weekly off
{{ ucfirst($employee->weekly_off ?: 'Sunday') }}

This month

Attendance records
{{ $employee->attendanceRecords->where('attendance_date','>=',now()->startOfMonth())->count() }}
Approved leave
{{ $employee->leaveRequests->where('status','approved')->where('from_date','>=',now()->startOfMonth())->sum('total_days') }} day(s)
Documents expiring in 90 days
{{ $employee->documents->where('is_current',true)->filter(fn($d)=>$d->expiry_date && $d->expiry_date->between(today(),today()->addDays(90)))->count() }}

UAE compliance summary

@foreach([['Passport',$employee->passport_number,$employee->passport_expiry],['Emirates ID',$employee->emirates_id,$employee->emirates_id_expiry],['Visa',$employee->visa_number,$employee->visa_expiry],['Work permit',$employee->work_permit_number,$employee->work_permit_expiry],['Insurance',$employee->insurance_number,$employee->insurance_expiry],['Contract',$employee->contract_end?'Active':'Not recorded',$employee->contract_end]] as [$label,$number,$expiry])

{{ $label }}

{{ $number ?: 'Not recorded' }}

{{ $expiry?->format('d M Y') ?? 'No expiry' }}

@endforeach

Access accountability

@if($employee->user)

ERP login active

{{ $employee->user->email }} · {{ $employee->user->roles->pluck('name')->join(', ') }}

Status {{ ucfirst($employee->user->status) }} · last login {{ $employee->user->last_login_at?->format('d M Y H:i') ?? 'never' }}

@else

No ERP login

This remains a standalone HR record until authorized access is created.

@endif

Employment & contact profile

@csrf @method('PUT') @foreach([['first_name','First name','text'],['middle_name','Middle name','text'],['last_name','Last name','text'],['display_name','Display name','text'],['email','Work email','email'],['mobile','UAE mobile','text'],['personal_email','Personal email','email'],['personal_mobile','Personal mobile','text'],['designation','Designation','text'],['joining_date','Joining date','date'],['contract_start','Contract start','date'],['contract_end','Contract end','date'],['probation_start','Probation start','date'],['probation_end','Probation end','date'],['work_location','Work location','text']] as [$name,$label,$type])@endforeach
@foreach([['passport_number','Passport number','text'],['passport_issue_date','Passport issue','date'],['passport_expiry','Passport expiry','date'],['emirates_id','Emirates ID','text'],['emirates_id_issue_date','EID issue','date'],['emirates_id_expiry','EID expiry','date'],['visa_number','Visa number','text'],['visa_issue_date','Visa issue','date'],['visa_expiry','Visa expiry','date'],['work_permit_number','Work permit','text'],['work_permit_issue_date','Work permit issue','date'],['work_permit_expiry','Work permit expiry','date'],['insurance_provider','Insurance provider','text'],['insurance_number','Insurance number','text'],['insurance_expiry','Insurance expiry','date']] as [$name,$label,$type])@endforeach
@if(auth()->check() && auth()->user()->hasPermission('employees.edit'))@endif
@if(auth()->check() && auth()->user()->hasPermission('employees.edit'))

Compliance document vault

Upload or renew a document. Uploading the same document type creates a new current version and preserves the previous file as historical.

@csrf
@endif
@forelse($employee->documents as $document)

{{ ucfirst(str_replace('_',' ',$document->document_type)) }}

v{{ $document->version_number }} · {{ $document->is_current ? 'current' : 'historical' }}

{{ $document->document_number ?: 'Number not recorded' }} · {{ $document->expiry_date?->format('d M Y') ?? 'No expiry' }}

{{ str_replace('_',' ',$document->status) }}
@if($document->attachment_path)Secure download@endif @if($document->is_current) @if(auth()->check() && auth()->user()->hasPermission('employees.edit'))
@csrf
@endif @endif
@if($document->verified_at)

Reviewed by {{ $document->verifiedByUser?->name }} on {{ $document->verified_at->format('d M Y H:i') }}

@endif
@empty

No employee documents

Upload the first passport, visa, Emirates ID or employment document.

@endforelse

Recent attendance

Original records remain linked to any correction request.

Full attendance view
@forelse($employee->attendanceRecords as $record)@empty@endforelse
DateStatusCheck inCheck outWorkedLateOT
{{ $record->attendance_date->format('d M Y') }}{{ ucfirst(str_replace('_',' ',$record->status)) }}{{ $record->actual_check_in?->format('H:i') ?? '—' }}{{ $record->actual_check_out?->format('H:i') ?? '—' }}{{ intdiv($record->worked_minutes,60) }}h {{ $record->worked_minutes%60 }}m{{ $record->late_minutes }}m{{ $record->overtime_minutes }}m
No attendance recorded.

Leave balances

@forelse($employee->leaveBalances->where('year',now()->year) as $balance)

{{ $balance->leaveType->name }}

Used {{ $balance->used }}

{{ $balance->available }}

@empty

Balances are created when leave is first requested.

@endforelse

Leave history

Open leave center
@forelse($employee->leaveRequests->sortByDesc('created_at') as $leave)

{{ $leave->leaveType->name }}

{{ $leave->from_date->format('d M') }}–{{ $leave->to_date->format('d M Y') }} · {{ $leave->total_days }} day(s)

{{ str_replace('_',' ',$leave->status) }}
@empty

No leave requests.

@endforelse
@if(auth()->check() && auth()->user()->hasPermission('payroll.salary.view'))

Salary history

@forelse($employee->salaryStructures as $salary)

AED {{ number_format((float)$salary->basic_salary,2) }} basic

Housing {{ number_format((float)$salary->housing_allowance,2) }} · transport {{ number_format((float)$salary->transport_allowance,2) }} · other {{ number_format((float)$salary->other_fixed_allowance+(float)$salary->variable_allowance,2) }}

From {{ $salary->effective_from->format('d M Y') }}
{{ $salary->effective_to?->format('d M Y') ?? 'Current' }}

{{ $salary->change_reason }}

@empty

No salary structure. Payroll calculation will be blocked for this employee.

@endforelse

Bank / WPS

@if($employee->bankDetail)

IBAN

{{ $employee->bankDetail->maskedIban() }}

Sensitive values are encrypted and never rendered in full after saving.

@else

No bank/WPS details.

@endif
@if(auth()->check() && auth()->user()->hasPermission('payroll.salary.edit'))

New effective salary structure

@csrf
@endif @else
Your role cannot view salary, payroll or bank details.
@endif

Gratuity estimates

@if(auth()->check() && auth()->user()->hasPermission('gratuity.view'))Gratuity center@endif
@forelse($employee->gratuities as $gratuity)

AED {{ number_format((float)($gratuity->approved_amount??$gratuity->estimated_amount),2) }}

{{ number_format($gratuity->eligible_service_days/365,2) }} eligible years

{{ $gratuity->status }}
@empty

No estimate recorded.

@endforelse

Loans & advances

@forelse($employee->loans as $loan)

{{ $loan->loan_number }}

{{ ucfirst(str_replace('_',' ',$loan->type)) }} · {{ $loan->status }}

AED {{ number_format((float)$loan->remaining_amount,2) }}
remaining

@empty

No loans or advances.

@endforelse

Employee activity timeline

@forelse($activity as $event)

{{ ucfirst(str_replace(['.','_'],' ',$event->action)) }}

{{ $event->user?->name ?? 'System' }} · {{ $event->created_at->format('d M Y H:i') }}

@empty

No audited employee activity yet.

@endforelse
@endsection