【发布时间】:2016-10-05 08:01:28
【问题描述】:
首先我在 laravel 中实现分页,现在我想在删除 //$user = customer::paginate(2); 和链接 <!-- {{ $user->links() }} --> 时删除
现在它没有运行并显示错误
Macroable.php 第 74 行中的 ErrorException: 方法链接不存在。 (查看:C:\wamp64\www\laravel_crud\resources\views\viewall.blade.php)
viewall.blade.php
<body>
<a href="insert">Insert Customer</a>
<br>
<br>
<br>
<table>
<tr>
<th>Name</th>
<th>Email</th>
<th>Country</th>
<th>Grnder</th>
<th>Favorite</th>
<th>Image</th>
<th>Show By Id</th>
<th>Update</th>
<th>Delete</th>
</tr>
<tbody>
@foreach($user as $users)
<tr>
<td>{{$users->name}}</td>
<td>{{$users->email}}</td>
<td>{{$users->country}}</td>
<td>{{$users->gender}}</td>
<td>{{$users->favorite}}</td>
<td><img src="{{URL::to('/image/' . $users->image)}}" alt="" width=
"50px" height="50px"></td>
<td><a href="customer/{{$users->id}}">View By Id</td>
<td><a href="edit/{{$users->id}}">Update</td>
<td><a href="delete/{{$users->id}}">Delete</td>
</tr>
@endforeach
</tbody>
</table>
</body>
控制器
public function showall(){
$user = customer::all();
//$user = customer::paginate(2);
return view("viewall" , compact ('user'));
}
路线
Route::get("showall" , "testing@showall");
请帮忙解决谢谢
【问题讨论】:
标签: php pagination laravel-5.3