Support the ongoing development of Laravel.io →
Configuration
Last updated 2 years ago.
0

The slash is always missing:

Route::get('login', 'HomeController@showLogin');

must be:

Route::get('/login', 'HomeController@showLogin');
Last updated 2 years ago.
0

Any wildcard routes (so in your example {username} and {title} must come after all other routes.

What is happening is that it is reaching the route for {username} and matching everything - e.g /login will use HomeController@showDashboard with a variable of username => login as it has matched it on a wildcard

Last updated 2 years ago.
0

AlexCutts said:

Any wildcard routes (so in your example {username} and {title} must come after all other routes.

What is happening is that it is reaching the route for {username} and matching everything - e.g /login will use HomeController@showDashboard with a variable of username => login as it has matched it on a wildcard

that's right

Last updated 2 years ago.
0

Cheers guys, putting the wildcard routes at the end works a treat. Appreciate the help :)

Will

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.