@include('layouts.components.section-marker', ['section_name' => $title]) @php $sectionTranslations = collect($allTranslations) ->filter(function ($value, $key) use ($keyStart) { return str_starts_with($key, $keyStart); }) ->flatMap(function ($collection) { return $collection; }); $sectionTranslatable = []; $idToKeyMap = []; foreach ($staticContentSettings->where('type_form', 'string') as $setting) { if (str_starts_with($setting->key, $keyStart)) { $sectionTranslatable[] = [ 'name' => $setting->key, 'type' => 'text', 'label' => $setting->description, 'required' => false ]; $idToKeyMap[$setting->id] = $setting->key; } }; $preparedTranslations = $sectionTranslations->map(function ($translation) use ($idToKeyMap) { if (isset($idToKeyMap[$translation->record_id])) { // Altera a propriedade column_name em tempo de execução $translation->column_name = $idToKeyMap[$translation->record_id]; } return $translation; }); @endphp