vendredi 2 septembre 2016

pagination in laravel 5.3 when count of pages = 1

I have cities table and it has 7 cities I have a view page to display these cities with 10 cities per page

Controller:

    $cities = City::orderBy('id', 'desc')->paginate(10);
    return view('cities.home', compact('cities'));

View:

<div class="table-responsive panel panel-sky">
                   <table class="table table-striped table-hover">
                       <tr>
                          <th>#</th>
                          <th>Name</th>
                          <th>Created At</th>
                          <th>Action</th>
                       </tr>

                       @foreach($cities as $city)
                          <tr id="product">
                             <td></td>
                             <td></td>
                             <td></td>
                             <td>  
                                <a href=""><i class="glyphicon glyphicon-edit action-icon"></i></a>
                                &nbsp;&nbsp;&nbsp;&nbsp;
                                <a type="button" class="pointer" data-toggle="modal" data-target="#deleteModal" data-type="btn-danger" data-action="delete-product" data-id="" data-msg="Are you sure you want to delete this city?" data-title="Confirm Deletion">
                                    <span class='glyphicon glyphicon-remove action-icon'></span>                                                           
                                </a>
                             </td>
                          </tr>
                       @endforeach
                   </table>
               <div>

               <div class="col-md-12"><?php echo $cities->render(); ?> </div>  

but the issue is the paginate render is displayed with page#1, this issue occurred in laravel5.3 and did not find in laravel5.2

enter image description here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire