mironmg
264
12
Laravel

Routes issue

Posted 1 year ago by mironmg

Hi guys. I'm having some issues with the routing... The client wants an extra string added after the slug like below

Route::get('/users-by-country/{country-slug}-users', '[email protected]');

There's no issue if the country has a single word in it and the slug does not contain a "-" character. But if the country slug is something like "south-africa", the url becomes "south-africa-users" and the page returns a 404.

Any idea of a workaround ? Changing slugs in the database is not an option...neither is composing the slug in view-files and removing the "-users" bit in Controller.

Thanks a lot!

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.