diff --git a/resources/views/components/editable.blade.php b/resources/views/components/editable.blade.php index b8204dff..a2ec3d21 100644 --- a/resources/views/components/editable.blade.php +++ b/resources/views/components/editable.blade.php @@ -13,28 +13,28 @@ $resolveContent = function (string $currentTable, string $field, \Illuminate\Database\Eloquent\Model|\stdClass $row): ?string { $currentField = $field; $replace = fn($content) => preg_replace('#(.*?)#is', '', $content); - + /** @codeCoverageIgnore */ if (str_contains($currentField, '.')) { $data = \Illuminate\Support\Str::of($field)->explode('.'); $table = $data->get(0); $field = $data->get(1); - + if ($table === $currentTable) { return $replace($row->{$field}); } - + return $replace($row->{$table}->{$field}); } - + return $replace($row->{$field}); }; - + $fallback = html_entity_decode(strval(data_get($editable, 'fallback')), ENT_QUOTES, 'utf-8'); $value = html_entity_decode(strval($resolveContent($currentTable, $field, $row)), ENT_QUOTES, 'utf-8'); - + $content = !empty($value) || $value == '0' ? $value : $fallback; - + $params = [ 'theme' => $theme->name, 'tableName' => $tableName, @@ -45,6 +45,7 @@ ]; @endphp