Thinkphp route matching problem

Route::post("xdk/plan","xdk/plan/save");
Route::post("xdk/plan/:id/fav","xdk/plan/fav");
Route::post("xdk/plan/:id/comments","xdk/plan/comments"); //

is to build a restful style api
/ xdk/plan post
/ xdk/plan/:id/fav like
/ xdk/plan/:id/comments comment

Why did

/ xdl/plan/2/fav match into the first release route?

Mar.12,2021

there is an exact match in the configuration file

 // 
    'route_complete_match'   => true,

Route::post('xdk/plan$','xdk/plan/save');
Route::post('xdk/plan/:id/fav$','xdk/plan/fav');
Route::post('xdk/plan/:id/comments$','xdk/plan/comments'); //

first of all, you can add a $ at the end of each route to avoid this situation.
secondly, tp5 has its own routing function that supports RESTFul, which only needs

.
Route::resource('xdk/plan','xdk/plan');

can achieve resource routing. For more information, please see the official document: tp resource routing

. The route of

Thinkphp5 is matched one by one from top to bottom, and the fourth parameter of the route can be used to match the regular expression.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2c2ff-2bafe.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2c2ff-2bafe.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?