Macroable.php第74行中的ErrorException:方法链接不存在

时间:2016-10-05 08:01:28

标签: php pagination laravel-5.3

首先我在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");

请帮助解决问题,谢谢

1 个答案:

答案 0 :(得分:1)

您需要使用Blade评论{{-- {{ $user->links() }} --}}
使用HTML评论<!-- {{ this still running }} -->