@extends('layouts.dashboard') @section('title', $department->name . ' - Department Details') @section('content')
Back to Departments

{{ $department->name }}

{{ ucfirst($department->status) }} Created {{ $department->created_at->diffForHumans() }}

Department Description

@if($department->description)

{{ $department->description }}

@else

No description provided

@endif

Department Employees

{{ $employees->total() }} employees
@if($employees->count() > 0)
@foreach($employees as $employee) @endforeach
Employee Role Status Hire Date
{{ $employee->name }}
{{ $employee->employee_id }}
@foreach($employee->roles as $role) {{ ucfirst($role->name) }} @endforeach {{ ucfirst($employee->status) }} {{ $employee->hire_date ? $employee->hire_date->format('M d, Y') : 'N/A' }}
@if($employees->hasPages())
{{ $employees->links() }}
@endif @else

No Employees

No employees are assigned to this department yet.

Add New Employee
@endif

Department Stats

Total Employees
{{ $employees->total() }}
Active Employees
{{ $department->users()->where('status', 'active')->count() }}
Supervisors
{{ $department->users()->whereHas('roles', function($q) { $q->where('name', 'supervisor'); })->count() }}

Department Information

Created On {{ $department->created_at->format('F d, Y') }}
Last Updated {{ $department->updated_at->format('F d, Y') }}
Department ID {{ $department->id }}

Quick Actions

Edit Department Add Employee @if($department->users()->count() == 0)
@csrf @method('DELETE')
@endif
@endsection