Laravel 5.2 - Method links does not exist
问题 i'm passing my array $posts to my view and i'm tryng use pagination but i have the error: Method links does not exist. (View: C:\xampp\htdocs\app\resources\views\search.blade.php) CONTROLLER $posts = Post::where('visible', 1) ->where('expire_date', '>', $current)->where('delete', 0); $posts->paginate(1); $posts = $posts->get(); return view('search', compact('posts')); VIEW <div class="pagination-bar text-center"> {{ $posts->links() }} </div> 回答1: Change you code to this: $posts = Post::where(