1 week ago

Split a page into multiple pages using pagination

Posted 1 week ago by mohamedhamidi

I am making a blog , in the view sometimes the body is too long and want to divide it into parts and add 'previous' , 'next' buttons , but the problem is that the body is stored all in one column in database so how can i paginate it ?

show.blade.php (the article show view) :

    <div class="post-image">
      <img class="mb-5" src="{{ $post->image_url }}" alt="{{ $post->slug }}">

    <div class="post-title">
      <h1 class="mb-4" >{{ $post->title }}</h1>

  <div class="post-body mb-5">
    {!! $post->body_html !!}

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