@php $isValidHex = static fn($color) => is_string($color) && preg_match('/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/', $color); $hexToRgb = static function ($hex) { $hex = ltrim($hex, '#'); if (strlen($hex) === 3) { $hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2]; } return [hexdec(substr($hex, 0, 2)), hexdec(substr($hex, 2, 2)), hexdec(substr($hex, 4, 2))]; }; $primaryColor = isset($systemSetting) && $isValidHex($systemSetting->primary_color ?? null) ? $systemSetting->primary_color : '#14796e'; $secondaryColor = isset($systemSetting) && $isValidHex($systemSetting->secondary_color ?? null) ? $systemSetting->secondary_color : '#69b8af'; $primaryRgb = implode(', ', $hexToRgb($primaryColor)); @endphp
Continue with a company. System data and actions will remain limited to that company.