@php $oldContent = json_decode(old('editor_content', ''), true); $document = is_array($oldContent) ? $oldContent : $translation->editor_content; if ($document === null) { $document = [ 'type' => 'doc', 'content' => array_map(function ($block) { $content = []; foreach (explode("\n", $block) as $index => $line) { if ($index > 0) { $content[] = ['type' => 'hardBreak']; } if ($line !== '') { $content[] = ['type' => 'text', 'text' => $line]; } } return $content ? ['type' => 'paragraph', 'content' => $content] : ['type' => 'paragraph']; }, preg_split('/\n{2,}/u', $translation->value)), ]; } @endphp Скасувати Повернутись до тексту
@csrf @method('PUT')
{{ $translation->language->label }} @if ($canGrade) @endif Зберегти зміни