Dronax
198
6
Laravel

Foreach paginate pages Laravel

Posted 2 months ago by Dronax

Hello. I have a code:

 $posts = Post::paginate(100);

How I can foreach pages of pagination and show results? I need in every file write a posts.

 foreach($posts as $page => $post) {
      //put on file current posts of page with file name: file-posts-$page.txt
 }

How I can do it?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.