@extends('Manager.layout') @section('title',"Employee") @section('page-name',"Employee") @section('page-detail',"All Employees Information") @section('pagelink', 'employee') @section('body')
@foreach ($employees as $employee) @if( $employee->role != 'Manager' ) @endif @endforeach
Employee Name Employee ID Role Category Hire Date Status Assigned Emojis Action
@if (!empty($employee->image)) Employee Image @else {{ strtoupper(implode('', array_merge(array_map(fn($part) => is_numeric($part) ? $part : $part[0], array_slice(explode(' ', $employee->name), 0, 2)),preg_match('/\d/', $employee->name, $matches) ? [$matches[0]] : []))) }} @endif @php $latestEmoji = \App\Models\EmojiAssignment::with('emoji') ->where('assignable_id', $employee->employee_id) ->where('assignable_type', 'App\Models\Employee') ->where('tenant_id', $employee->tenant_id) ->orderBy('created_at', 'desc') ->first(); @endphp @if($latestEmoji)
@if($latestEmoji->emoji->type === 'emoji') {{ $latestEmoji->emoji->emoji_text }} @else {{ $latestEmoji->emoji->name }} @endif
@endif
{{ $employee->name }}
{{$employee->employee_id}} {{$employee->role ?? 'N/A'}} {{$employee->category ?? 'N/A'}} {{ $employee->created_at->format('m-d-y') }} @if($employee->status === '2') Active @elseif($employee->status === '1') Inactive @else Pending @endif
@php $assignedEmojis = \App\Models\EmojiAssignment::with('emoji') ->where('assignable_id', $employee->employee_id) ->where('assignable_type', 'App\Models\Employee') ->where('tenant_id', $employee->tenant_id) ->orderBy('created_at', 'desc') ->take(3) ->get(); @endphp @if($assignedEmojis->count() > 0)
@foreach($assignedEmojis as $assignment)
@if($assignment->emoji->type === 'emoji') {{ $assignment->emoji->emoji_text }} @else {{ $assignment->emoji->name }} @endif
@endforeach @if($assignedEmojis->count() >= 3) +{{ \App\Models\EmojiAssignment::where('assignable_id', $employee->employee_id)->where('assignable_type', 'App\Models\Employee')->where('tenant_id', $employee->tenant_id)->count() - 3 }} @endif
@else None @endif
@endsection @section('custom-scripts') @endsection