//分页
public function test9(){
$users=Member::paginate(2);
return view('home.test.test9',compact(['users']));
}
@extends('home.test.parent')
@section('main')
<table>
<tbody>
<tr>
<th>id</th>
<th>姓名</th>
<th>年龄</th>
<th>邮箱</th>
<th>头像</th>
</tr>
@foreach($users as $val)
<tr>
<td>
{{$val->id}}
</td>
<td>
{{$val->name}}
</td>
<td>
{{$val->age}}
</td>
<td>
{{$val->email}}
</td>
<td>
<img src="/uploads/{{$val->url}}" alt="">
</td>
</tr>
@endforeach
</tbody>
</table>
<div>
{{$users->links()}}
</div>
@endsection