查询条件是默认找主键的?
前端的间可以随便起名字,然后 方法注入模型的时候会默认与表的主键进行匹配对吗?
http://{{local}}/api/users/:id/replies?include=topic.user
http://{{local}}/api/users/:user_id/replies?include=topic.user
public function userIndex(User $user){
$replies = $user->replies()->paginate(20);
return $this->paginator($replies, new ReplyTransformer());
}
推荐文章: