In controller we have to use
paginate
method
public function index()
{
    $posts = Post::orderBy('title', 'asc')->paginate(1);
    return $posts;
}
In blade template we will have pagination
{{$posts->links()}}
if there are less records then per page, pagination will not appear
by Valeri Tandilashvili
4 years ago
Laravel
model methods
Laravel From Scratch
0
Pro tip: use ```triple backticks around text``` to write in code fences