IMO this is just a bad idea. As your project scales, it's going to get more confusing. How will you even know what are all the routes that you have if you do this?
Routing url to controller/action
Hi,
I'm new to Laravel and I want to setup a routing that takes a controller and action from the url and automatically routes it to the corresponding controller and action
So instead of this:
Route::get('/', 'IndexController@index');
I would like to do something like:
Route::get('{controller}/{action}', '{controller}Controller@{action}');
So if the url would be /user/posts that it would automatically go to the posts() action in the UserController without specifying routes each controller and action separately. Is that possible? Is it also possible for multi-language websites? For example that /user/posts (english) and /utilisateur/poste (french) would both be automatically routed to the same posts() action in the UserController.
Thanks.
Please or to participate in this conversation.