S
S
Shamil Khairulaev2021-07-13 20:39:58
Laravel
Shamil Khairulaev, 2021-07-13 20:39:58

Why don't the $posts->links() paginator buttons work?

I want to set up pagination of posts on the site, but the pagination buttons do not redirect to the next pagination page. When I click next, the page just reloads.

The code:

//Страница всех постов---------------------------------------------------------
        $posts = Post::all()
            ->sortDesc();

        // Конечные переменные---------------------
        $posts = new Paginator($posts, 1);//Пагинатор с постами
        //_________________________________________

        return view('blog.posts.index', compact('posts'));
        //________________________________________________________________________________


Calling buttons in the ribbon:
{{$posts->links()}}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question