-
Notifications
You must be signed in to change notification settings - Fork 898
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
[4.0][BUG] Unable to prepare route for serialization. #2523
Comments
Hello there! Thanks for opening your first issue on this repo! Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that. Backpack communication mediums:
Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch. Thank you! -- |
Sorry @shbov , I don't think it's a bug in Backpack - I've just tried it and it seems to work fine in my projects: Take a closer look at all your routes, maybe you've created two Hope it helps. |
Hi again. The error does not happen only for route admin/category, it's also happen to route admin/permission (or any route genereted by Route::crud). Maybe I'm doing something wrong. routes/backpack/custom.php
routes/backpack/permissionmanager.php
php artisan route:list
|
Try clearing your cache @shbov |
Tried, same result. |
Hmmm this is indeed weird. Yes you do have two routes with the same route name. All CRUDs do. Sidenote: this makes me wonder why we don't just remove one of them - opened an issue for it here. But. The fact that there are two routes with the same name should NOT trigger an error. It does not do so for me. And it does not do so for @pxpm . So it's very weird... I'm sorry @shbov but I don't know if I can be of any more help in this matter - might be a local env thing... or a matter of using a certain package that hooks into the optimize command... something like that... I don't know... |
@tabacitu i have same error. fresh laravel with backpack and some new crud, generated with command. I use docker with image php:7.4-fpm-alpine
same name store
|
I am so sorry for closing this. I am still not 100% sure what is causing this, but I can confirm it's happening. Route::group([
'prefix' => config('backpack.base.route_prefix', 'admin'),
'middleware' => ['web', config('backpack.base.middleware_key', 'admin')],
'namespace' => 'App\Http\Controllers\Admin',
], function () { // custom admin routes
Route::crud('test', 'TestCrudController');
}); // this should be the absolute last line of this file Gives me the error:
I am re-opening this, and I need to dig deeper. If anyone else found a solution, please let us know. |
As me and @tabacitu already suspected. Dunno why now it's complaining, we are just going to make sure we don't use the route anywhere like #2525 @lotarbo indeed, I have also confirmed that removing the PUT route ends the problem. I think it's safe to remove because we are not using it, we use the POST one. I will open a PR for it. Thank you all for the input, it really helped to tackle this one down. |
@pxpm looks like this is new https://github.com/laravel/framework/blob/a85f93244ae46a6542409c4296da6764795be14d/src/Illuminate/Routing/AbstractRouteCollection.php#L199 |
#2529 is now merged and tagged. So a |
Hi @pxpm @tabacitu
PHP VERSION:PHP 7.4.9 (cli) (built: Aug 7 2020 19:23:06) ( NTS ) LARAVEL VERSION:v8.25.0@05da44d6823c2923597519ac10151f5827a24f80 BACKPACK VERSION:4.1.32@1a65e15562989c8fda3d2941da7110ca4008e21e |
Hello @azaricstefan Most probably you are using 2 auth systems, and both define the same Maybe using laravel auth + backpack auth ? Try changing the name of laravel route (to avoid overwritting backpack). Let me know, |
Laravel auth is defined with: How could I change the name? Why would this be an issue if backpack has prefix for his routes? |
Hmm, I just checked routes with this name and it looks like it's not related to Backpack after all. Just to write how I resolved it -> I removed nascent-africa/jetstrap from composer.json since I am not using it still. Thanks for replying btw, @pxpm. |
Thank to
|
Bug report
What I did
php artisan optimize
What happened
Backpack, Laravel, PHP, DB version
The text was updated successfully, but these errors were encountered: