Skip to content

Commit

Permalink
security: use signed middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
pxlrbt committed Aug 12, 2024
1 parent aa440eb commit bda4289
Showing 1 changed file with 8 additions and 1 deletion.
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');

0 comments on commit bda4289

Please sign in to comment.