@extends('layouts.app') @section('title', 'Departments') @section('subtitle', 'Manage organizational departments') @section('content')
@if(session('success'))

{{ session('success') }}

@endif @if(session('error'))

{{ session('error') }}

@endif
Add

Total Departments

{{ \App\Models\Department::count() }}

Active

{{ \App\Models\Department::where('is_active', true)->count() }}

Total Employees

{{ \App\Models\User::count() }}

Avg per Dept

{{ \App\Models\Department::count() > 0 ? round(\App\Models\User::count() / \App\Models\Department::count(), 1) : 0 }}

Department List

{{ \App\Models\Department::count() }} departments
@forelse($departments as $department) @empty @endforelse
Department Employees Status Actions
{{ $department->name }}
{{ $department->description ? Str::limit($department->description, 50) : 'No description' }}
{{ $department->users_count }} @if($department->is_active) Active @else Inactive @endif
@csrf @method('DELETE')

No departments found

Start by creating your first department

@if($departments->hasPages())
Showing {{ $departments->firstItem() }} to {{ $departments->lastItem() }} of {{ $departments->total() }} results
@if($departments->onFirstPage()) Previous @else Previous @endif @foreach($departments->getUrlRange(1, $departments->lastPage()) as $page => $url) @if($page == $departments->currentPage()) {{ $page }} @else {{ $page }} @endif @endforeach @if($departments->hasMorePages()) Next @else Next @endif
@endif
@endsection