Hello everyone, I ran into a small problem. Suppose there are routes:
Route::get('category/{id}/{action}') It turns out that links in the form
/category/1/show /category/1/edit /category/1/remove Approach our route. All this is good, but it is necessary that they be carried out in different methods . And this is no longer possible. I tried this way:
Route::get('category/{id}/{action}', "Controller@show")->where("action"=>"show") Route::get('category/{id}/{action}', "Controller@edit")->where("action"=>"edit") Route::get('category/{id}/{action}', "Controller@remove")->where("action"=>"remove") But with such a scheme, the last route is always executed.
I’m not suggesting an option with a pars URL. I want to understand whether it is possible to do this by means of laravel
Route::resource('category', 'Controller')not suitable for this purpose? - Rustam Gimranov"action"=>"show", then why not Route :: get ('category / {id} / show', "Controller @ show")? In general,Route::resource('category', 'Controller')is more correct - Rustam Gimranov{action}use as an intermediary so as not to write the same code in the controller maths - Evgeny Nikolaev