[Bug] Route parameter problem after upgrade from laravel 5.8 to laravel 6.0 with backpack crud 3.6.33
See original GitHub issueBug report
Hello,
I’m try to upgrade from laravel 5.8 to laravel 6 and stay with backpack version 3.6.33 (our project is large and the transition to backpack 4 is complex 😉 ) and I’have strange issue
Now, when I use
route ('crud.opportunity.edit', ['id' => 'x'])
I have the following error:
Missing required parameters for [Route: crud.opportunity.edit] [URI: opportunity / {opportunity} / edit]
But with
route ('crud.opportunity.edit', ['opportunity' => 'x'])
That’s work fine
Do you have some idea why the required parameter name have changed?
- before (laravel 5.8): {id}
- after (laravel 6): {opportunity}
Thanks for your help
Backpack, Laravel, PHP, DB version
- PHP 7.2.28-3+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Feb 23 2020 07:23:01) ( NTS )
- backpack/base 1.1.13
- backpack/crud 3.6.33
- backpack/generators 1.2.7
- laravel/framework v6.18.18
- Database : PostgreSQL
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Upgrade Guide - The PHP Framework For Web Artisans
The storagePath method of the Illuminate\Contracts\Foundation\Application interface has been updated to accept a $path argument.
Read more >Laravel 8 + backpack error on "php artisan backpack:crud ...
The version you got has that error and you need to bump your version to get the fix, your PHP and Laravel versions...
Read more >Upgrade Guide :: 4.0 Docs - Backpack for Laravel
This will guide you through upgrading from Backpack 3.6 to 4.0. Backpack v4 is a paid upgrade. You can upgrade your project and...
Read more >BackpackForLaravel/Lobby - Gitter
Has anyone had trouble with observer events being fired? Specifically saved/created/updated. I'm using Laravel 5.8, Backpack Crud 3.6.
Read more >MonsterCrudController - Code Metrics - Laravel-Backpack/demo
The trait Backpack\CRUD\app\Http\C...erations\FetchOperation requires the property $wheres which is not provided by App\Http\Controllers\Admin\ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well done @yvesnetalis very nice and clean solution.
Thank you very much for making it public, it might help someone that struggles with same problem.
Best, Pedro
Hello @pxpm
Thank you to your answer
I had read Laravel’s upgrade page but it didn’t help much. I have not found what has changed in Laravel’s code.
But I found how to fix this in backpack 😄
In
crud/src/CrudRouter.php
, I added the following code on$options_with_defaut_route_names
arrayProblem solved !
Have a good day, Yves