@extends('layouts.app') @section('title', 'Dashboard') @section('header', ($dashboard['role'] ? $dashboard['role'] . ' Dashboard' : 'Dashboard')) @section('subheader', 'Welcome back, ' . auth()->user()->name) @section('content') {{-- Quick Actions --}} @if (! empty($dashboard['quickActions']))
@foreach ($dashboard['quickActions'] as $action) {{ $action['label'] }} @endforeach
@endif {{-- Stat Cards --}}
@forelse ($dashboard['cards'] as $card)
{{ $card['label'] }}
{{ $card['value'] }}
@empty
No metrics available for your role yet.
@endforelse
{{-- Attendance Summary --}} @if ($dashboard['attendanceSummary']) @php $summary = $dashboard['attendanceSummary']; @endphp
Attendance Summary {{ $summary['scope'] }}
@foreach (['present' => 'Present', 'late' => 'Late', 'half_day' => 'Half Day', 'on_leave' => 'On Leave', 'absent' => 'Absent', 'holiday' => 'Holiday'] as $status => $label)
{{ $summary['counts'][$status] ?? 0 }}
@endforeach
@endif {{-- Charts --}} @if (! empty($dashboard['charts']))
@foreach ($dashboard['charts'] as $chart)
@endforeach
@endif
{{-- Pending Leaves --}}
Pending Leaves
    @forelse ($dashboard['pendingLeaves'] as $leave)
  • {{ $leave->employee?->full_name ?? 'You' }}
    {{ $leave->leaveType?->name }} ยท {{ $leave->start_date->format('d M') }} โ€“ {{ $leave->end_date->format('d M') }} ({{ $leave->days }}d)
  • @empty
  • No pending leave requests.
  • @endforelse
{{-- Upcoming Birthdays --}} @if ($dashboard['upcomingBirthdays']->isNotEmpty())
Upcoming Birthdays
    @foreach ($dashboard['upcomingBirthdays'] as $birthday)
  • {{ $birthday['employee']->full_name }}
    {{ $birthday['employee']->department?->name ?? 'โ€”' }}
    {{ $birthday['date']->format('d M') }}
    @if ($birthday['inDays'] === 0) Today ๐ŸŽ‚ @elseif ($birthday['inDays'] === 1) Tomorrow @else in {{ $birthday['inDays'] }} days @endif
  • @endforeach
@endif
{{-- Recent Activities --}}

Recent Activities

@if ($dashboard['recentActivities']->isEmpty())

No recent activity recorded.

@else @endif
@endsection