From 8d503760f27e5e6d4a97b57699d5105e5d346e58 Mon Sep 17 00:00:00 2001 From: Elisa Goloviatinski Date: Wed, 18 Dec 2024 18:26:47 +0100 Subject: [PATCH] Added back ability for guest users to see details of global timelines --- timeliner/routes/web.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/timeliner/routes/web.php b/timeliner/routes/web.php index 52aabef..afcb1d8 100644 --- a/timeliner/routes/web.php +++ b/timeliner/routes/web.php @@ -25,7 +25,13 @@ require __DIR__.'/auth.php'; -Route::resource('timeline', TimelineController::class)->middleware(['auth', 'verified']); +// Make sure only timeline.show route is accessible by guest users +Route::resource('timeline', TimelineController::class) + ->except(['show']) + ->middleware(['auth', 'verified']); + +Route::get('timeline/{timeline}', [TimelineController::class, 'show'])->name('timeline.show'); + Route::post('comment', [CommentController::class, 'store'])->middleware(['auth', 'verified'])->name('comment.store'); Route::delete('comment/{comment}', [CommentController::class, 'destroy'])->middleware(['auth', 'verified'])->name('comment.destroy');