framework: [L6.6.0] Breaking routing bug

  • Laravel Version: 6.6.0
  • PHP Version: 7.3.11
  • Database Driver & Version: MariaDB 10.4

Description:

There is a critical routing bug in L6.6.0 Working in L6.5.2 and less

Steps To Reproduce:

Two routes like this (routes/web.php) : Route::prefix(‘admin’)->group(function() { Route::get('boutiques','AdminComparateurController@shops')->name('admin.shops'); Route::get('boutiques/{shop}','AdminComparateurController@shopId')->name('admin.shops.id')->where(['shop'=>'[0-9]+']); });

Go to the URL : /admin/boutiques In L6.6.0 error 500 : Missing required parameters for [Route: admin.shops.id] [URI: admin/boutiques/{shop}]

It take the boutiques/{shop} route instead of the first one, changing orders of the route : same bug It break the application !

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 19 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Ya, needs to be reverted it seems and yes, a better fix will need to be implemented i guess.

Hopefully @driesvints can revert it and do a patch release ASAP.

@neoteknic It makes sure you actually have parameters for your routes. While an error is inconvenient, it’s in my opinion better than it silently giving you the wrong URL. Which happened to me, causing a bug for users. Guess this could be closed as it does what it’s supposed to do.