0

My paginate function is not working correctly for one set of data. The data is just disappearing after the set number of paginate. When I go to the correct url and enter page 2 it will appear but not giving me the option of switching pages at the bottom of the web page like it should.

I have used the same good from the one I have working but it does not seem to do the job.

    $vulnerabilitys = Vulnerability::orderBy('risk', 'asc')->paginate(6);
    return view('vulnerabilities.index')>with('vulnerabilitys',$vulnerabilitys);

I expect the result to give me the option to change to the next page at the bottom of the data, by having a page 1/2/3 etc.

2 Answers2

1

Did you add {{ $vulnerabilitys->links() }} to your view?

See Laravel Pagination

Loko
  • 185
  • 3
  • 12
0

@if(count($vulnerabilitys)>0) @foreach ($vulnerabilitys as $vulnerability) <div class = "well"> <h3><a href="/vulnerabilities/{{$vulnerability->id}}">{{$vulnerability->risk}}</a></h3> <small>{{$vulnerability->description}}</small> </div> @endforeach {{$vulnerabilitys->links()}}