linuxserver / Heimdall

An Application dashboard and launcher
MIT License
7.46k stars 540 forks source link

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

Closed tech62 closed 1 month ago

tech62 commented 4 months ago

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):

LinuxServer-CI commented 3 months ago

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.

github-actions[bot] commented 2 days ago

This issue is locked due to inactivity