how to create pagination

isurutmv

Well-known member
  • May 1, 2013
    1,936
    823
    113
    29
    Gampaha
    PHP:
    <div class="row clearfix">
                    @foreach($distric->area_list as $area_list)
    
                       @foreach($area_list->directory as $directory)
                       @foreach($directory->dir_category_sub_set as $dir_category_sub_set)
                       @if($dir_category_sub_set->sub_category_id == '557057')
       
                        <div class="col-sm-4 col-xs-6">
                          <div class="single-product">
                            <figure>
                              <img src="/img/content/post-img-12.jpg" alt="">
    
                              <div class="rating">
                                <ul class="list-inline">
                                  <li><a href="#"><i class="fa fa-star"></i></a></li>
                                  <li><a href="#"><i class="fa fa-star"></i></a></li>
                                  <li><a href="#"><i class="fa fa-star"></i></a></li>
                                  <li><a href="#"><i class="fa fa-star-half-o"></i></a></li>
                                  <li><a href="#"><i class="fa fa-star-o"></i></a></li>
                                </ul>
    
                                <p>Featured</p>
    
                              </div> <!-- end .rating -->
    
                              <figcaption>
                                <div class="bookmark">
                                  <a href="https://hanuma.lk/{{$directory->field_link}}"><i class="fa fa-bookmark-o"></i> Bookmark</a>
                                </div>
    
                                <div class="read-more">
                                  <a href="https://hanuma.lk/{{$directory->field_link}}"><i class="fa fa-angle-right"></i> Read More</a>
                                </div>
    
                              </figcaption>
                            </figure>
    
                            <h4><a href="https://hanuma.lk/{{$directory->field_link}}">{{$directory->name_of_the_business_place}}</a></h4>
    
                            <h5><a href="https://hanuma.lk/{{$directory->field_link}}">{{$directory->address_no_of_the_business_place}},{{$directory->address_street_of_the_business_place}}</a>, <a href="/land/{{$directory->directory_id}}">{{$area_list->name}},{{$distric->name}}</a></h5>
    
                            <p>T.P:
                              @if($directory->phone_of_the_business_place>0)
                              {{$directory->phone_of_the_business_place}}/
                              @endif
    
                              {{$directory->mobile_of_the_business_place}} <br> {{$directory->created_date}}</p>
    
                            <a class="read-more" href="https://hanuma.lk/{{$directory->field_link}}"><i class="fa fa-angle-right"></i>Read More</a>
    
                          </div> <!-- end .single-product -->
                        </div> <!-- end .grid-layout -->
                        @endif  
                          @endforeach
                          @endforeach
                          @endforeach


    mcn mata oya code ekata pagination ekak hadaganna oone ooka karanne kohomada kiyapallako :confused::confused::confused:
     

    NecroMonger

    Active member
  • Dec 27, 2011
    145
    63
    28
    Since you have nested loops, pagination will be not easy.. I found the below example to be the solution you want.. but I think your approach of pagination is very inefficient but that's only my opinion.

    Link