When looking for a route, Laravel looks through the Routes file in order for the FIRST Route it finds that matches the request.
Route::resource('city', 'CityController'); covers all route requests starting with 'city' so it should be placed AFTER any specific 'city/,,," routes.
There is no mention of this in the documentation that I could find.
Also, If it works, what is the problem?
mvolo is right.
Use patterns to prevent this.
Route::pattern('id', '[0-9]+');
Laravel will recognize that "names" is not a number and there won't be any match in the resourceful controller.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community