linuxserver / Heimdall-Apps

Apps for Heimdall
MIT License
298 stars 321 forks source link

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

Closed tech62 closed 7 months ago

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

mvdkleijn commented 7 months ago

First, thanks for the feedback.

Second, sadly I must close it since this is an issue for the main https://github.com/linuxserver/Heimdall repository. Because I don't have write access to the main Heimdall repository, I cannot transfer the issue myself, only close it.

Feel free to comment if you need me to re-open for some reason.