首先我在laravel中实现分页,现在我想在删除//$user = customer::paginate(2);
和链接<!-- {{ $user->links() }} -->
时删除现在它不运行并显示错误
ErrorException in Macroable.php line 74:方法链接不存在。(观点:C: ' wamp64 ' www资源' laravel_crud ' ' 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'));
}
<<p> 路线/strong> Route::get("showall" , "testing@showall");
Please Help to fix it谢谢
您需要使用刀片注释{{-- {{ $user->links() }} --}}
与HTML注释<!-- {{ this still running }} -->