在你的问题中,你paginate()
很可能会调用一个集合.
在有效的答案中,你正在呼唤paginate()
一位雄辩的建设者.
Auth::user()->tournaments; // dynamic property for relationship, probably a collection Auth::user()->tournaments(); // relation type object (eloquent builder)
你的答案:
$tournaments = Tournament::where('user_id',Auth::user()->id) ->paginate(Config::get('constants.PAGINATION'));
where
正在回复你正在呼唤的雄辩的建设者paginate
.
这应该会给你相同的结果:
$tournaments = Auth::user()->tournaments()->paginate(...);