@extends('PointsAdmin.layout') @section('title',"Employee") @section('page-name',"Employee") @section('page-detail',"All Employees Information") @section('pagelink', 'employee') @section('body')
| Employee Name | Employee ID | Department | Role | Category | Hire Date | Status | Assigned Emojis | Action | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
@if (!empty($employee->image))
@if($latestEmoji->emoji->type === 'emoji')
{{ $latestEmoji->emoji->emoji_text }}
@else
@endif
{{ Str::limit($employee->name, 15) }} |
{{$employee->employee_id}} | @if($employee->department === null){{"Unspecfied"}} | @else{{$employee->department->name ?? 'N/A'}} | @endif @if($employee->role === null){{"Unspecfied"}} | @else{{$employee->role ?? 'N/A'}} | @endif @if($employee->category === null){{"Unspecfied"}} | @else{{ Str::limit($employee->category ?? 'N/A', 15) }} | @endif{{ $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)
@else
None
@endif
@if($assignment->emoji->type === 'emoji')
{{ $assignment->emoji->emoji_text }}
@else
@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
|