samedi 19 septembre 2015

Laravel5 Pagination Links Getting 404 Error

I developed a laravel web application and created a pagination view of business list...

enter image description here

I have two business rows in my business table and collecting each one row in a view give pagination for accessing others...

Controller..

public function businessindex(){
    $arr = DB::table('business')->paginate(1);
    $arr->setPath('business');
    return View::make('admin.SABC.businessindex')->with('data',$arr);
}

Routes.php

Route::get('business',['as'=>'business','uses'=>'SABusinessCustomersController@businessindex']);

View.

   <tbody>
                <?php $i=1;?>
                @foreach($data as $datas)
  <tr>
                  <td>{{$i++}}</td>
                  <td>{{$datas->ci_busns_name}}</td>
                  <td>{{$ctgry}}</td>
                  <td>{{date('M-d-Y',strtotime($datas->created_at))}}</td>
                  <td><span class="{{$grenclass}}">{{$status}}</span><span class="{{$redclass}}" id="{{$datas->pk_business_id}}">{{$oppostatus}}</span></td>
                  <td><span class="{{$lgrenclass}}">{{$lglstatus}}</span><span class="{{$lredclass}}" id="{{$datas->pk_business_id}}">{{$opplgl}}</span></td>
                  <td>
                      <span><a class="editThis" id="{{Crypt::encrypt($datas->pk_business_id)}}" href="{{URL::route('edit_business_view',[Crypt::encrypt($datas->pk_business_id)])}}"></a></span>
                      <span><a onclick="return confirm('Are you sure you want to delete this item?');"
                       class="dltThis" href="{{URL::route('brand_delte',[$datas->pk_business_id])}}"></a></span>
                    </td>
                </tr>
                @endforeach
      </tbody>
 </table>
 <span class="totalContspan">Showing 0 to {{$i-1}} of {{$i-1}} entries</span>  
             <div class="paghdlr">{!! str_replace('/?', '?', $data->render()) !!}</div>
             <div class="clearfix"></div>

Now I am getting like above screenshot,, its sending too many ajax request continuously in my page. I can see that from network tab of Firebug.

When Click on the links Its throwing an ajax request and get 404 error, I doesn't try the laravel ajax pagination in my site. Only required the Laravel Pagination.

How can i solve this issue..?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire