@extends('layouts.app') @section('page_title', 'My Profile') @section('content')
{{ strtoupper($user->role) }}

{{ $user->name }}

{{ $user->designation }}

{{ $user->email }}

{{ $user->department->name ?? 'N/A' }}

{{ $user->phone ?? 'Not provided' }}

{{ $user->created_at->format('d M, Y') }}

Leave Balance ({{ date('Y') }})
@php $balance = $user->leaveBalances->where('year', date('Y'))->first(); @endphp @if ($balance)
Annual Leaves {{ $balance->annual_total - $balance->annual_used }} / {{ $balance->annual_total }}
Sick Leaves {{ $balance->sick_total - $balance->sick_used }} / {{ $balance->sick_total }}
Casual Leaves {{ $balance->casual_total - $balance->casual_used }} / {{ $balance->casual_total }}
@else

No balance info found for this year.

@endif
Recent Attendance Logic (Last 30 Days)
@foreach ($user->attendances as $att) @endforeach
Date In Out Total Status
{{ $att->date->format('d M, Y') }} {{ $att->check_in ? $att->check_in->format('h:i A') : '-' }} {{ $att->check_out ? $att->check_out->format('h:i A') : '-' }} {{ floor($att->total_work_minutes / 60) }}h {{ $att->total_work_minutes % 60 }}m {{ ucfirst($att->status) }}
Leave Applications
Apply Leave
@forelse($user->leaves as $lv) @empty @endforelse
From/To Type Days Status
{{ $lv->from_date->format('d M') }} - {{ $lv->to_date->format('d M') }}
{{ $lv->reason }}
{{ ucfirst($lv->leave_type) }} {{ $lv->total_days }} {{ ucfirst($lv->status) }}
No leave requests found.
Change Password
@csrf
@endsection @push('styles') @endpush