From c616686fd6df1865be7edf33e0f755172076eb67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Thu, 28 Sep 2023 16:36:09 +0200 Subject: [PATCH] Put files download in public --- app/Http/Controllers/API/SyncController.php | 2 +- routes/web-bo.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/API/SyncController.php b/app/Http/Controllers/API/SyncController.php index ec28395..7d99f01 100644 --- a/app/Http/Controllers/API/SyncController.php +++ b/app/Http/Controllers/API/SyncController.php @@ -207,7 +207,7 @@ class SyncController extends Controller $exists = Storage::disk('public')->exists('docs/' . $doc['uuid'] . '.' . $doc['type']); if ($exists) { array_push($attach, URL::temporarySignedRoute( - 'bo.docs.download', + 'docs.download', now()->addDays(30), ['uuid' => $doc['uuid']] )); diff --git a/routes/web-bo.php b/routes/web-bo.php index 3775d96..5e419f1 100644 --- a/routes/web-bo.php +++ b/routes/web-bo.php @@ -23,10 +23,6 @@ Route::prefix('bo')->name('bo.')->middleware(['admin-secure'])->group(function ( ]); }); - Route::get('/docs/{uuid}/download', [DocumentController::class, 'download']) - ->name('docs.download') - ->middleware('signed'); - Route::middleware('auth:backend')->group(function () { Route::get('/', [DashboardController::class, 'index'])->name('dashboard'); @@ -72,3 +68,8 @@ Route::prefix('bo')->name('bo.')->middleware(['admin-secure'])->group(function ( Route::get('/', function () { return redirect()->route('bo.dashboard'); }); + +// * Public files download +Route::get('/docs/{uuid}/download', [DocumentController::class, 'download']) + ->name('docs.download') + ->middleware('signed');