Merge pull request #15860 from binaryfire/configurable-export-routes

Configurable utility route prefix
This commit is contained in:
Dan Harrin
2025-04-02 09:54:19 +01:00
committed by GitHub
3 changed files with 26 additions and 7 deletions
+11 -6
View File
@@ -4,10 +4,15 @@ use Filament\Actions\Exports\Http\Controllers\DownloadExport;
use Filament\Actions\Imports\Http\Controllers\DownloadImportFailureCsv;
use Illuminate\Support\Facades\Route;
Route::get('/filament/exports/{export}/download', DownloadExport::class)
->name('filament.exports.download')
->middleware('filament.actions');
$prefix = config('filament.system_route_prefix', 'filament');
Route::get('/filament/imports/{import}/failed-rows/download', DownloadImportFailureCsv::class)
->name('filament.imports.failed-rows.download')
->middleware('filament.actions');
Route::middleware('filament.actions')
->name('filament.')
->prefix($prefix)
->group(function () {
Route::get('/exports/{export}/download', DownloadExport::class)
->name('exports.download');
Route::get('/imports/{import}/failed-rows/download', DownloadImportFailureCsv::class)
->name('imports.failed-rows.download');
});
+12
View File
@@ -86,4 +86,16 @@ return [
'livewire_loading_delay' => 'default',
/*
|--------------------------------------------------------------------------
| System Route Prefix
|--------------------------------------------------------------------------
|
| This is the prefix used for the system routes that Filament registers,
| such as the routes for downloading exports and failed import rows.
|
*/
'system_route_prefix' => 'filament',
];
@@ -34,7 +34,9 @@
<span
x-text="
window.pluralize(@js(__('filament-tables::table.selection_indicator.selected_count')), {{ $selectedRecordsPropertyName }}.length, {
count: new Intl.NumberFormat(@js(str_replace('_', '-', $locale))).format({{ $selectedRecordsPropertyName }}.length),
count: new Intl.NumberFormat(@js(str_replace('_', '-', $locale))).format(
{{ $selectedRecordsPropertyName }}.length,
),
})
"
class="text-sm font-medium leading-6 text-gray-700 dark:text-gray-200"