Simple answer, don't put slashes in URLS. Use dashes instead maybe?
route parameters with "/"
Hello everyone,
I have a problem about routing
First of all, routes.php
Route::resource('user,'UserController');
url
user/{slug}/edit/
normally it works fine but if slug contains "/" (e.g. abc/123) it will breaks the routing and causes page not found.
I did some search about this issue and I found one in StackOverFlow
http://stackoverflow.com/questions/21552604/how-to-define-a-laravel-route-with-a-parameter-that-contains-a-slash-character
What if i need to do if I define routes using "resource" to handle this problem and is it good to allow route parameters contains "/" ?
Thanks a lot
You can encode your slashes on url, so it will not cause any problem, although it will not be pretty anymore.
So I suggest you to replace the slash by a dash.
Please or to participate in this conversation.