@extends('layouts.dashboard') @section('title', 'Department Management') @section('content')

Department Management

Manage your company departments and their details

Create Department

Total Departments

{{ $departments->total() }}

Active Departments

{{ \App\Models\Department::where('status', 'active')->count() }}

Inactive Departments

{{ \App\Models\Department::where('status', 'inactive')->count() }}

@if($departments->count() > 0)
@foreach($departments as $department) @endforeach
DEPARTMENT
EMPLOYEES
STATUS
CREATED
ACTIONS
{{ $department->name }}
{{ $department->description ?? 'No description' }}
{{ $department->users()->count() }} employees {{ ucfirst($department->status) }} {{ $department->created_at->format('M d, Y') }}
{{ $department->created_at->diffForHumans() }}
@csrf @method('DELETE')
@if($departments->hasPages())
{{ $departments->links() }}
@endif @else

No Departments Found

Get started by creating your first department.

Create Department
@endif
@endsection