Skip to content
Advertisement

Laravel 8 redirect web routes

It seems there is an error in my Laravel 8 routes somewhere.

My web routes file:

JavaScript

When going to /, it is redirected to /en. But when going to /dashboard it isn’t redirected to /dashboard/en but gives an error:

JavaScript

As can be seen, not a lot of information given.

Anyone knows what to do?

Advertisement

Answer

Found it:

Laravel handles routes from top to bottom. Which means it gets to /{locale} before it gets to /dashboard. In this case dashboard is seen as {locale} and the wrong route is taken.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement