Answer the question
In order to leave comments, you need to log in
How does dynamic routing work in laravel?
I registered the following route in the router in Laravel:
In theory, it should send all requests like "yoursite/post/{method}/{arg1}/..." to the controller "PostController", but for some reason it does not see the routes at all and how I understood that it cannot produce dynamic routing at all (that is, you need to specify a route for each URL).
(Gives an error "Route [post/add] not defined" although I have a "getAdd" method and I even tried to rename it simply to "add"
Did I understand everything correctly, or is it still possible not to prescribe? Route::controller('post', 'PostController');
Answer the question
In order to leave comments, you need to log in
Laravel uses Symfony/Routing. Purely theoretically, with the help of expressions, you can implement dynamic routing, but in general this approach is considered un-feng shui.
But generally yes. One controller action - one or more routes.
(Gives a "Route [post/add] not defined" error even though I have a "getAdd" method
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question