Laravel中的授权策略参数错误

Laravel中的授权策略参数错误,laravel,laravel-5.6,Laravel,Laravel 5.6,我能用这个做什么: “传递给App\Policys\NotePolicy::update()的参数1必须是 App\Note的实例,App\User的实例已给定,已调用 /Users/acny/Desktop/project/vendor/laravel/framework/src/light/Auth/Access/Gate.php 在第481行(查看:在此处输入代码 /Users/acny/Desktop/project/resources/views/notes/edit.blade.ph

我能用这个做什么:

“传递给App\Policys\NotePolicy::update()的参数1必须是 App\Note的实例,App\User的实例已给定,已调用 /Users/acny/Desktop/project/vendor/laravel/framework/src/light/Auth/Access/Gate.php 在第481行(查看:
在此处输入代码
/Users/acny/Desktop/project/resources/views/notes/edit.blade.php)

NotePolicy.php

public function update(Note $note, User $user)
    {
        return $user->id == $note->user_id;
    }
编辑.blade.php(用于显示更新按钮):

@can('update',$note)
更新说明
@恩德坎
如果我在edit.blade.php中编写所有内容而不是“更新”,那么我没有错误,但这不是我想要的。
谢谢你的帮助

Laravel将$user作为第一个参数传递。改变你的论点

@can('update', $note)
        <button type="submit" class="btn btn-primary">Update Note</button>
@endcan