Skip to content

Commit

Permalink
Merge pull request #197 from pxlrbt/fix/signed-middleware
Browse files Browse the repository at this point in the history
security: use signed middleware
  • Loading branch information
pxlrbt authored Aug 12, 2024
2 parents d955106 + 6b1808d commit 0d6f3f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
<?php

use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Storage;

Route::get('filament-excel/{path}', function (string $path) {
$path = Storage::disk('filament-excel')->path($path);
$filename = substr($path, 37);

return
response()
->download(Storage::disk('filament-excel')->path($path), substr($path, 37))
->download($path, $filename)
->deleteFileAfterSend();
})
->middleware(['web', 'signed'])
->where('path', '.*')
->name('filament-excel-download');
2 changes: 1 addition & 1 deletion src/Exports/Concerns/WithColumns.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ protected function createFieldMappingFromTable(): Collection
if ($livewire instanceof HasTable) {
$columns = collect($livewire->getTable()->getColumns());
} else {
$table = $this->getResourceClass()::table(new Table());
$table = $this->getResourceClass()::table(new Table);
$columns = collect($table->getColumns());
}

Expand Down

0 comments on commit 0d6f3f2

Please sign in to comment.