我正在尝试从我的表中获取数据并将其显示在我的视图中并对这些数据进行分页。我收到了这个问题,但找不到任何解决方案。我在之前的项目中做了完全相同的事情,而且效果很好。
这是我的控制器
public function hadiBirlikteCalisalimShow (){
$users =DB::table('birlikte_calisalim')->paginate(15);
return view('admin.birliktecalisalim',compact(['users']));
}
Run Code Online (Sandbox Code Playgroud)
这是我的观点
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>?sim</th>
<th>Email</th>
<th>Tarih</th>
<th>?stek</th>
</tr>
</thead>
<tbody>
@foreach($users as $row)
<tr>
<td>{{$users->name}}</td>
<td>{{$users->email}}</td>
<td>{{$users->tarih}}</td>
<td>{{$users->message}}</td>
</tr>
@endforeach
</tbody>
</table>
{{$users->links()}}
Run Code Online (Sandbox Code Playgroud)