Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - Can't clear cache with php artisan:optimize - Tag routes are declared twice #1310

Open
tech62 opened this issue Mar 7, 2024 · 1 comment

Comments

@tech62
Copy link

tech62 commented Mar 7, 2024

Describe the bug

Do a php artisan optimize from server CLI

   INFO  Caching the framework bootstrap files.

  config ................................................................................................................................. 97ms DONE
  routes ................................................................................................................................. 83ms FAIL

   LogicException

  Unable to prepare route [tag/{slug}] for serialization. Another route has already been assigned name [tags.show].

  at vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php:247
    243▕             $route->name($this->generateRouteName());
    244▕
    245▕             $this->add($route);
    246▕         } elseif (! is_null($symfonyRoutes->get($name))) {
  ➜ 247▕             throw new LogicException("Unable to prepare route [{$route->uri}] for serialization. Another route has already been assigned name [{$name}].");
    248▕         }
    249▕
    250▕         $symfonyRoutes->add($route->getName(), $route->toSymfonyRoute());
    251▕

      +34 vendor frames
  35  artisan:35
      Illuminate\Foundation\Console\Kernel::handle()

Routes à declared twice in routes/web.php

Route::resource('tags', TagController::class);

**Route::name('tags.')->prefix('tag')->group(function () {
    Route::get('/{slug}', [TagController::class, 'show'])->name('show');
    Route::get('/add/{tag}/{item}', [TagController::class, 'add'])->name('add');
    Route::get('/restore/{id}', [TagController::class, 'restore'])->name('restore');
});**

I think the part between ** need to be in app/Http/Controllers/TagController.php

Expected behavior
config ................................................................................................................................. 97ms DONE
routes ................................................................................................................................. 83ms DONE

Version info (please complete the following information):

  • Heimdall: last version available
@LinuxServer-CI
Copy link

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Non-Docker Issues
Development

No branches or pull requests

2 participants