laravel 注入那点事
作者:互联网
public function delete(Group $groupId, Post $postId) { $postId->delete(); return response()->json(null, 204); }
路由:
$route->delete('/groups/{groupId}/posts/{postId}', Admin\GroupPostController::class.'@delete');
注意: 注入的对象一定要和路由参数一样才会生效($postId 路由参数就必须是postId)
标签:laravel,那点,参数,注入,postId,groupId,路由,delete 来源: https://www.cnblogs.com/sgm4231/p/10297015.html