label('Fassung veröffentlichen') ->schema([ Textarea::make('body')->label('Text'), FileUpload::make('incoming')->label('Datei')->disk('cms_incoming')->directory('inhalte'), TextInput::make('change_note')->label('Änderungsnotiz'), ]) ->action(function (array $data): void { $this->report(function () use ($data): void { /** @var ContentElement $element */ $element = $this->getRecord(); $metadata = filled($data['incoming'] ?? null) ? ['incoming' => $data['incoming']] : []; app(ContentService::class)->publishElementVersion( $element, $data['body'] ?? null, $metadata, $data['change_note'] ?? null, ); }, 'Die Fassung ist gespeichert.'); $this->getRecord()->unsetRelations(); $this->getRecord()->refresh(); }), ]; } }