label('Использовать блок как SEO-текст') ->helperText('Этот текст будет использоваться для SEO-оптимизации') ->live(onBlur: true) ->required() ->disabled(function ($state, Get $get) { $data = $get('../../'); return self::findSeoActive($data) && !$state; }) ->dehydrated(), TinyEditor::make('content') ->label('Текст') ->placeholder('Начните вводить текст...') ->profile('test') ->required() ->helperText('Основное текстовое содержимое блока'), ]; } private static function findSeoActive(array $data) : bool { $bool = false; foreach ($data as $item) { if ($item['type'] !== 'paragraph') { continue; } if ($item['data']['seo_active'] === true) { $bool = true; break; } } return $bool; } }