如何给 follows 中间表添加一个 recent () 查询方法?
Method Illuminate\Database\Query\Builder::recent does not exist.
public function followers(User $user)
{
$followers =$user->followers()->recent()->paginate(20);
return $this->response->paginator($followers, new FollowerTransformer());
}
上面代码会提示中间表不存在recent方法.
推荐文章: