question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Route parameter problem after upgrade from laravel 5.8 to laravel 6.0 with backpack crud 3.6.33

See original GitHub issue

Bug 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:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pxpmcommented, Jun 5, 2020

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

1reaction
yvesnetaliscommented, Jun 5, 2020

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 array

'parameters' => [
    $this->name => 'id',
]

Capture du 2020-06-05 11-59-08

Problem solved !

Have a good day, Yves

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found