Skip to content

Commit

Permalink
Resolve route name clashes to enable cache generation (#2869)
Browse files Browse the repository at this point in the history
* Resolve route name clashes to enable cache generation

Clashing route names in `routes/web_v2.php` caused the error:

  Unable to prepare route [X/Y] for serialization. Another route has
  already been assigned name [X].

when running `php artisan route:cache`.

This commit ensures that all routes have unique names, allowing the
artisan command to successfully generate the route cache.

* formatting
  • Loading branch information
kiancross authored Jan 2, 2025
1 parent 98305ff commit 637e3f9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions routes/web_v2.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
Route::get('/gallery/{albumId}/{photoId}', [VueController::class, 'view'])->name('gallery-photo')->middleware(['migration:complete', 'unlock_with_password']);

Route::get('/frame', [VueController::class, 'view'])->name('frame')->middleware(['migration:complete']);
Route::get('/frame/{albumId}', [VueController::class, 'view'])->name('frame')->middleware(['migration:complete']);
Route::get('/frame/{albumId}', [VueController::class, 'view'])->name('frame-album')->middleware(['migration:complete']);

Route::get('/map', [VueController::class, 'view'])->name('map')->middleware(['migration:complete']);
Route::get('/map/{albumId}', [VueController::class, 'view'])->name('map')->middleware(['migration:complete']);
Route::get('/map/{albumId}', [VueController::class, 'view'])->name('map-album')->middleware(['migration:complete']);

// later
Route::get('/search', [VueController::class, 'view'])->middleware(['migration:complete']);
Route::get('/search/{albumId}', [VueController::class, 'view'])->middleware(['migration:complete']);
Route::get('/search/{albumId}/{photoId}', [VueController::class, 'view'])->middleware(['migration:complete']);
Route::get('/search', [VueController::class, 'view'])->name('search')->middleware(['migration:complete']);
Route::get('/search/{albumId}', [VueController::class, 'view'])->name('search-album')->middleware(['migration:complete']);
Route::get('/search/{albumId}/{photoId}', [VueController::class, 'view'])->name('search-photo')->middleware(['migration:complete']);

Route::get('/profile', [VueController::class, 'view'])->name('profile')->middleware(['migration:complete', 'login_required:always']);
Route::get('/users', [VueController::class, 'view'])->middleware(['migration:complete', 'login_required:always']);
Expand Down

0 comments on commit 637e3f9

Please sign in to comment.