Level 29
Yes, that is true for such kinds, i.e. name doesn't matter. However, for implicit route model binding variable name should match the route parameter.
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a problem in basic laravel route parameters order. For example.
Route::get('user/{id}/{name}'),function($id,$name){
return "Your id is $id and name is $name";
});
and
Route::get('user/{id}/{name}'),function($name,$id){
return "Your id is $id and name is $name";
});
The first one is right.The second one the content are opposite.So i don't have to make their names are same, right?
Yes, that is true for such kinds, i.e. name doesn't matter. However, for implicit route model binding variable name should match the route parameter.
Please or to participate in this conversation.