david001's avatar

500 (Internal Server Error) Laravel--ajax Pagination

iam getting 500 (Internal Server Error) when i click the links of pagination and donot have an idea to fix it My view

@extends('layouts.master')
<head>
   <head><meta id="token" name="token" content="{ { csrf_token() } }"></head>


    <title>Laravel AJAX Pagination with JQuery</title>

</head>
@section('content')

<br><br><br>
<div class="users">

   
    @foreach ($allusers as $user)
    <p>   {{$user->name}}</p>

    

   @endforeach
  
{!!str_replace('/?','?', $allusers->render()) !!}

</div>
@stop

@section('script')
    <script>
    
    $(document).ready(function() {
        $(document).on('click', '.pagination a', function (e) {
            e.preventDefault();
            var pageid = $(this).attr('href').split('page=')[1];
            $.ajax({
            url :"{{URL::to('/')}}/extindex",
            data:{page:pageid},
            dataType:'json',
            type:'get',
        success:function(data)
       {
          $('.users').html();
       }
   });
});

});
</script>
@stop
0 likes
6 replies
david001's avatar

i got 500 (Internal Server Error) on console

david001's avatar

what should i do in blade so that i can fix it

jekinney's avatar

With Chrome dev tools, go to network tab. You should see your API call in red (due to errror). Click on it and go to preview tab. It should show you stack error.

Please or to participate in this conversation.