@php if (isset($data)) { // Decode JSON string $valueArray = is_string($data->value) ? json_decode($data->value, true) : $data->value; $valueArray = is_array($valueArray) ? $valueArray : []; // No need for mapWithKeys — keys already exist $webhooks = collect($valueArray); $key = $data->key ?? ''; } else { $webhooks = collect([]); $key = ''; } @endphp @include('layouts.components.section-marker', ['section_name' => 'Fornecedores'])