label('Element anlegen') ->visible(fn (): bool => ContentElementResource::editor()) ->schema([ TextInput::make('working_title')->label('Arbeitstitel')->required(), Select::make('kind')->label('Art')->options([ 'film' => 'Film', 'audio' => 'Audio', 'bild' => 'Bild', 'pdf' => 'PDF', 'text' => 'Text', 'aufgabe' => 'Aufgabe', ])->required(), Select::make('output_class')->label('Ausgabeklasse')->options([ 'film' => 'Film', 'audio' => 'Audio', 'bild' => 'Bild', 'pdf' => 'PDF', 'text' => 'Text', ])->required(), ]) ->action(function (array $data): void { $this->report(function () use ($data): void { app(ContentService::class)->createElement($data['kind'], $data['output_class'], $data['working_title']); }, 'Das Inhaltselement ist angelegt.'); }), ]; } }