when I use pagination I lose the other records that are being retrieved from the database
ex: on the first page I can see all the records but when I go on the next http://127.0.0.1:8000/irrigation?page=2
the records get lost.
app.blade.php these records below are the ones that are getting lost
<div class="col-lg-3">
<div class="widget">
<h5 class="widgetheading">Latest posts</h5>
<ul class="link-list">
@foreach($construction as $constructions)
<li><a href="/constructions/{{ $constructions->id }}">{{ $constructions->title }}</a></li>
@endforeach
@foreach($bicycle as $bicycles)
<li><a href="/bicycles/{{ $bicycles->id }}">{{ $bicycles->title }}</a></li>
@endforeach
@foreach($marshland as $marshlands)
<li><a href="/marshlands/{{ $marshlands->id }}">{{ $marshlands->title }}</a></li>
@endforeach
@foreach($irrigation as $irrigations)
<li><a href="/irrigation/{{ $irrigations->id }}">{{ $irrigations->title }}</a></li>
@endforeach
</ul>
</div>
</div>
irrigation_ps.blade.php
<div class="container">
<div class="row">
<div class="col-md-10">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Related Posts</strong>
</div>
@foreach($irrigation_ps as $irrigation_pst)
<div class="panel-body">
<div class="media">
<a class="media-left" href="#">
<img src="{{ Storage::url($irrigation_pst->slug) }}" width="300" height="100%" alt="">
</a>
<div class="media-body">
<h4 class="media-heading">{{ $irrigation_pst->title }}</h4>
<p>{{ $irrigation_pst->litle_desc }}</p>
<div class="ficon">
<a href="/irrigation/{{ $irrigation_pst->id }}" alt="">Learn more</a> <i class="fa fa-long-arrow-right"></i>
</div>
</div>
</div>
</div>
@endforeach
</div>
</div>
</div>
</div>
<div class="container">
<nav>
{{ $irrigation_ps->links('pagination') }}
</nav>
</div>
this my controller
public function index()
{
$irrigation_ps = Irrigation::OrderBy('id', 'desc')->paginate(1);
$footers = Footer::OrderBy('id', 'desc')->paginate(1);
// our services
$construction = Contruction::OrderBy('id', 'desc')->paginate(1);
$bicycle = Bicycle::OrderBy('id', 'desc')->paginate(1);
$marshland = Marshland::OrderBy('id', 'desc')->paginate(1);
$irrigation = Irrigation::OrderBy('id', 'desc')->paginate(1);
return view('project.pages.irrigation_ps', [
'irrigation_ps' => $irrigation_ps,
'footers' => $footers,
//our services
'construction' => $construction,
'bicycle' => $bicycle,
'marshland' => $marshland,
'irrigation' => $irrigation,
]);
}
I don't know where the problem is and why they get lost
am using laravel 8 but in laravel 6 I had no error like this please explain to me