【问题标题】:ErrorException in Macroable.php line 74: Method links does not existMacroable.php 第 74 行中的 ErrorException:方法链接不存在
【发布时间】: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


    【解决方案1】:

    您需要使用 Blade cmets {{-- {{ $user-&gt;links() }} --}}
    与 HTML cmets &lt;!-- {{ this still running }} --&gt;

    【讨论】:

    • 解决了我的问题
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-29
    • 2016-12-16
    相关资源
    最近更新 更多