@if ($myUser->is_hr_manager)
Is HR Directorr: @if ($user->is_hr_manager == 1) Yes @else No @endif
Is HR Headquarters: @if ($user->is_hr_hq == 1) Yes @else No @endif
Is line manager: @if ($user->is_line_manager == 1) Yes @else No @endif
Is holiday approver: @if ($user->is_holiday_approver == 1) Yes @else No @endif
Admin/Regular: @if ($user->isadmin == '1') Administrator @else Regular @endif
@php // Extract IDs from report_to field, handling potential trailing/leading spaces $admin_loc = explode(',', trim($user->admin_location)); // Convert Collection to array using toArray() $names = \App\Models\Location::whereIn('id', $admin_loc)->pluck('locationname')->toArray(); // Ensure names are retrieved successfully if ($names) { // Handle multiple names appropriately if (count($names) === 1) { $badgeTextAL = $names[0]; } else { // Customize comma or other separator as needed $badgeTextAL = implode(', ', $names); } } else { // Handle missing name scenario (e.g., provide a placeholder) $badgeTextAL = '—'; // Or any appropriate message } @endphp Admin by location(s): {{ $badgeTextAL }}
@php // Extract IDs from report_to field, handling potential trailing/leading spaces $admin_Team = explode(',', trim($user->admin_team)); // Convert Collection to array using toArray() $TeamNames = \App\Models\Team::whereIn('id', $admin_Team)->pluck('team')->toArray(); // Ensure names are retrieved successfully if ($TeamNames) { // Handle multiple names appropriately if (count($TeamNames) === 1) { $badgeTextAT = $TeamNames[0]; } else { // Customize comma or other separator as needed $badgeTextAT = implode(', ', $TeamNames); } } else { // Handle missing name scenario (e.g., provide a placeholder) $badgeTextAT = '—'; // Or any appropriate message } @endphp Admin by team(s): {{ $badgeTextAT }}
Employee status *: @if ($user->status == '1') Current Employee @else Ex-Employee @endif
@php // Extract IDs from report_to field, handling potential trailing/leading spaces $admin_sections = array_map('trim', explode(',', $user->admin_sections)); // Remove any empty values $admin_sections = array_filter($admin_sections); // Ensure names are retrieved successfully if (!empty($admin_sections)) { // Handle multiple names appropriately if (count($admin_sections) === 1) { $badgeTextAS = $admin_sections[0]; } else { // Customize comma or other separator as needed $badgeTextAS = implode(', ', $admin_sections); } } else { // Handle missing name scenario (e.g., provide a placeholder) $badgeTextAS = '—'; // Or any appropriate message } @endphp Manage access the section(s): {{ $badgeTextAS }}
Allow add employee: @if ($user->add_employee == true) Yes @else No @endif
@elseif ($myUser->is_hr_hq)
Is HR Headquarters: @if ($user->is_hr_hq == 1) Yes @else No @endif
Is line manager: @if ($user->is_line_manager == 1) Yes @else No @endif
Is holiday approver: @if ($user->is_holiday_approver == 1) Yes @else No @endif
Employee status *: @if ($user->status == '1') Current Employee @else Ex-Employee @endif
Admin/Regular: @if ($user->isadmin == '1') Administrator @else Regular @endif
@php // Extract IDs from report_to field, handling potential trailing/leading spaces $admin_loc = explode(',', trim($user->admin_location)); // Convert Collection to array using toArray() $names = \App\Models\Location::whereIn('id', $admin_loc)->pluck('locationname')->toArray(); // Ensure names are retrieved successfully if ($names) { // Handle multiple names appropriately if (count($names) === 1) { $badgeTextAL = $names[0]; } else { // Customize comma or other separator as needed $badgeTextAL = implode(', ', $names); } } else { // Handle missing name scenario (e.g., provide a placeholder) $badgeTextAL = '—'; // Or any appropriate message } @endphp Admin by location(s): {{ $badgeTextAL }}
@php // Extract IDs from report_to field, handling potential trailing/leading spaces $admin_Team = explode(',', trim($user->admin_team)); // Convert Collection to array using toArray() $TeamNames = \App\Models\Team::whereIn('id', $admin_Team)->pluck('team')->toArray(); // Ensure names are retrieved successfully if ($TeamNames) { // Handle multiple names appropriately if (count($TeamNames) === 1) { $badgeTextAT = $TeamNames[0]; } else { // Customize comma or other separator as needed $badgeTextAT = implode(', ', $TeamNames); } } else { // Handle missing name scenario (e.g., provide a placeholder) $badgeTextAT = '—'; // Or any appropriate message } @endphp Admin by team(s): {{ $badgeTextAT }}
@php // Extract IDs from report_to field, handling potential trailing/leading spaces $admin_sections = array_map('trim', explode(',', $user->admin_sections)); // Remove any empty values $admin_sections = array_filter($admin_sections); // Ensure names are retrieved successfully if (!empty($admin_sections)) { // Handle multiple names appropriately if (count($admin_sections) === 1) { $badgeTextAS = $admin_sections[0]; } else { // Customize comma or other separator as needed $badgeTextAS = implode(', ', $admin_sections); } } else { // Handle missing name scenario (e.g., provide a placeholder) $badgeTextAS = '—'; // Or any appropriate message } @endphp Manage access the section(s): {{ $badgeTextAS }}
Allow add employee: @if ($user->add_employee == true) Yes @else No @endif
@elseif ($myUser->isadmin)
Is line manager: @if ($user->is_line_manager == 1) Yes @else No @endif
Is holiday approver: @if ($user->is_holiday_approver == 1) Yes @else No @endif
Employee status *: @if ($user->status == '1') Current Employee @else Ex-Employee @endif
@else
You do not have permissions.
@endif