From da0db012a0f2c5ee571580f29dfa741e41928f69 Mon Sep 17 00:00:00 2001 From: Ovidiu U Date: Thu, 11 Jun 2026 13:34:32 +0100 Subject: [PATCH] Drop duplicate 'logout' route name so route:cache works MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SPA's GET /logout and Fortify's POST /logout both carried the name 'logout', which is fine at runtime (distinct verbs, same URL) but breaks route:cache (names must be unique for serialization). The Blade auth forms target route('logout') = Fortify's POST route, so the custom GET route — used by the SPA via a literal /logout URL — no longer needs the name. Co-Authored-By: Claude Opus 4.8 (1M context) --- routes/web.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/routes/web.php b/routes/web.php index f6e7bc1..deeeb98 100644 --- a/routes/web.php +++ b/routes/web.php @@ -8,14 +8,17 @@ use Illuminate\Support\Facades\Route; // Named dashboard route so route('dashboard') resolves; Vue Router handles rendering Route::get('/dashboard', fn () => view('app'))->middleware(['auth', 'verified'])->name('dashboard'); -// Server-side logout — handles hard navigation to /logout +// Server-side logout for the SPA's hard navigation (GET /logout). +// Intentionally unnamed: the `logout` route name belongs to Fortify's POST /logout, +// which the Blade auth forms target via route('logout'). Both can share the /logout +// URL (different verbs), but two routes cannot share a name — that breaks route:cache. Route::get('/logout', function (Request $request) { Auth::logout(); $request->session()->invalidate(); $request->session()->regenerateToken(); return redirect('/'); -})->middleware('auth')->name('logout'); +})->middleware('auth'); Route::middleware(['auth'])->prefix('billing')->name('billing.')->group(function () { Route::get('/checkout/{tier}/{cadence}', [BillingController::class, 'checkout'])->name('checkout');