@extends('layouts.app') @section('title', 'Staff') @section('content') @php /* |-------------------------------------------------------------------------- | Dynamic Staff Statistics |-------------------------------------------------------------------------- */ $totalStaff = $staff->count(); $activeStaff = $staff->where('is_active', 1)->count(); $administrators = $staff->filter(function ($member) { $roleName = strtolower(trim($member->role->role_name ?? '')); return str_contains($roleName, 'admin'); })->count(); $orderTakers = $staff->filter(function ($member) { $roleName = strtolower(trim($member->role->role_name ?? '')); return str_contains($roleName, 'order taker'); })->count(); // Progress percentages $activePercentage = $totalStaff > 0 ? round(($activeStaff / $totalStaff) * 100) : 0; $administratorPercentage = $totalStaff > 0 ? round(($administrators / $totalStaff) * 100) : 0; $orderTakerPercentage = $totalStaff > 0 ? round(($orderTakers / $totalStaff) * 100) : 0; @endphp
Total Staff
Active Staff
Administrators
Order Taker
|
|
Staff Name | Email Address | Role | Status | Actions | ||
|---|---|---|---|---|---|---|---|
|
|
{{-- Staff Name --}}
{{ $member->user_name }} | {{-- Email --}}{{ $member->user_email }} | {{-- Role --}}{{ $member->role->role_name ?? 'No Role' }} | {{-- Status --}}@if($member->is_active) Active @else Inactive @endif | {{-- Actions --}}|||
| No staff members found. | |||||||