控制器
$news = News::where('type_id',1)->where('is_del',1)->paginate(3);
前端
@if($news->currentPage() == 1)
@else
<li><a href="{{url('news?page=1')}}">首页</a></li>
<li><a href="{{$news->previousPageUrl()}}">上一页</a></li>
<li><a href="{{$news->previousPageUrl()}}">{{$news->currentPage()-1}}</a></li>
@endif
<li><a class="active">{{$news->currentPage()}}</a></li>
@if($news->currentPage() == $news->lastPage())
@else
<li><a href="{{$news->nextPageUrl()}}">{{$news->currentPage()+1}}</a></li>
<li><a href="{{$news->nextPageUrl()}}">下一页</a></li>
<li><a href="{{url('news?page=').$news->lastPage()}}">尾页</a></li>
@endif
效果
//paginate()返回数据