@extends('hr_main') @section('title', '| ' . $data['pageTitle']) @section('content')
{!! $data['pageTitle'] !!}
  • Employee
    Position
    Joining Date
  • @php // Function to convert string to a consistent color hue function stringToHue($string) { $hash = 0; for ($i = 0; $i < strlen($string); $i++) { $hash = ord($string[$i]) + (($hash << 5) - $hash); } return abs($hash) % 360; // hue between 0 and 359 } @endphp @foreach ($data['employees'] as $entry) @php $posName = $entry->position_name; $hue = stringToHue(strtolower($posName)); $bgColor = "hsl($hue, 60%, 85%)"; // light background $textColor = "hsl($hue, 80%, 30%)"; // darker text for contrast @endphp
  • {{ $entry->emp_name_english }}
    {{ $posName }}
    {{ \Carbon\Carbon::parse($entry->joining_date)->format('d-m-Y') }}
  • @endforeach
@endsection @section('footerAssets') @endsection