Laravel returns 404 when route has multiple parameters

Viewed 397

I've upgraded from 5.8 to 6 to 7 following the documentation. Now I have a problem where the verification email route returns 404.

I've had a read around and seen a few errors where people have not followed the docs. I have read and implemented the below from the upgrade guide.

"The route path for verifying emails has changed from /email/verify/{id} to /email/verify/{id}/{hash}."

But there seems to some underlying routing problem. With a little more investigation I've discovered that this works:

Route::get('/email/verify/{id}/{other}', function($id, $other){
    dd([$id,$other]);
});

and this does not (the route auth uses but with a closure to test):

Route::get('/email/verify/{id}/{hash}', function($id, $hash){
    dd([$id,$hash]);
});

the rest of the web.php routes file is empty.

It would seem using the word hash causes the 404 rather than displaying the array.

When using:

Auth::routes(['verify' => true]); 

the route:list command does display the expected route.

Any help greatly appreciated!

0 Answers
Related