@php $defaults = config('theme-section-colors', []); $sc = is_array($sectionColors ?? null) ? $sectionColors : []; if (is_string($sectionColors ?? null)) { $sc = json_decode($sectionColors, true) ?? []; } $tc = $themeConfig ?? []; $val = static function (string $key) use ($sc, $tc, $defaults) { $v = $sc[$key] ?? $defaults[$key] ?? $tc[$key] ?? null; return is_string($v) ? trim($v) : $v; }; $primary = $val('primary') ?: '#65971e'; @endphp