Laravel Route issues with Route order in web.php

前端 未结 2 1306
清酒与你
清酒与你 2020-12-18 05:27

I have problem with routes in Laravel, I\'m following one tutorial and we have this routes listed in web.php file

Route::get(\'/home\', \'HomeController@inde         


        
2条回答
  •  一生所求
    2020-12-18 06:14

    You can't define a type on a route paramater. So Laravel is guessing that you parameter can be a Integer or even a String.

    Based on that, If you try to access /blog/bin. Laravel will try to use the route /blog/{id} with "bin" in id param.

    Here a better answer than mine : https://laracasts.com/discuss/channels/laravel/order-of-routes-being-applied/replies/149199

提交回复
热议问题