Open davidbuzz opened 2 years ago
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
Yeah, we should probably fix this - repeated route names probably are going to eventually break in some version of the framework.
BTW, why are you doing the optimize
step? Just trying to get things to 'go faster' or is there something specific you're trying to do? (This is more from curiosity than anything else, of course)
I already have a branch in process to fix this. It was because of the Great Route Changes of Laravel 8. :( Not hard to do, but LOTS of places reference routes by name, so we have to be careful with testing.
Well, it sounds like php artisan optimize
will be a great development tool for that! Hah :) I'll assign it to you then.
No, it won't - it will only check to see that the routes can be cached (and there are often lots of valid reasons they can't be, including constructors that do weird things). I mean testing the app, tits to toenails by testing to make sure we're not 500ing - it's going to be a bear.
"clone/license" is also assigned in routes/web.php and in /routes/web/licenses.php
It’s a known issue (there are waaaay more than just that one). It’s kinda low priority though, since it’s not necessary to run the optimize command. When benched, it doesn’t offer that much
Debug mode
Describe the bug
$ php artisan optimize Configuration cache cleared! Configuration cached successfully! Route cache cleared!
LogicException
Unable to prepare route [hardware/{assetId}/checkout] for serialization. Another route has already been assigned name [checkout/hardware].
at vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php:218 214▕ $route->name($name = $this->generateRouteName()); 215▕ 216▕ $this->add($route); 217▕ } elseif (! is_null($symfonyRoutes->get($name))) { ➜ 218▕ throw new LogicException("Unable to prepare route [{$route->uri}] for serialization. Another route has already been assigned name [{$name}]."); 219▕ } 220▕ 221▕ $symfonyRoutes->add($route->getName(), $route->toSymfonyRoute()); 222▕
31 artisan:35 Illuminate\Foundation\Console\Kernel::handle()
Reproduction steps
...
Expected behavior
it should run without error
Screenshots
No response
Snipe-IT Version
6.0.1
Operating System
ubuntu linux
Web Server
CLI
PHP Version
7.4
Operating System
n/a
Browser
n/a
Version
n/a
Device
No response
Operating System
No response
Browser
No response
Version
No response
Error messages
Additional context
No response