Skip to content

Commit defb9b3

Browse files
committed
add exporter to config
1 parent a3a05a9 commit defb9b3

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

config/inspirecms.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@
121121

122122
'exports' => [
123123
'disk' => 'local',
124+
'exporters' => [
125+
\SolutionForest\InspireCms\Exports\Exporters\DocumentTypeExporter::class,
126+
\SolutionForest\InspireCms\Exports\Exporters\FieldGroupExporter::class,
127+
\SolutionForest\InspireCms\Exports\Exporters\TemplateExporter::class,
128+
],
124129
],
125130

126131
'models' => [

src/Exports/Exporters/BaseExporter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ abstract public static function getArgsFormFields(): array;
3030

3131
public static function getLabel(): string
3232
{
33-
return str(static::class)->classBasename()->studly()->toString();
33+
return str(static::class)->classBasename()->snake()->replace('_', ' ')->apa()->toString();
3434
}
3535

3636
/**

src/Filament/Resources/ExportResource.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,7 @@ public static function infolist(Infolist $infolist): Infolist
131131

132132
public static function form(Form $form): Form
133133
{
134-
$exporters = collect([
135-
\SolutionForest\InspireCms\Exports\Exporters\DocumentTypeExporter::class,
136-
\SolutionForest\InspireCms\Exports\Exporters\FieldGroupExporter::class,
137-
\SolutionForest\InspireCms\Exports\Exporters\TemplateExporter::class,
138-
])
134+
$exporters = collect(InspireCmsConfig::get('exports.exporters', []))
139135
->mapWithKeys(fn ($exporter) => [$exporter => $exporter::getLabel()])
140136
->all();
141137

0 commit comments

Comments
 (0)