Silvanite / novatoolpermissions

Laravel Nova Permissions Tool (User, Roles and Permissions / Access Control (ACL))
MIT License
101 stars 33 forks source link

BlogPolicy gives error per documentation #28

Closed joeelia closed 5 years ago

joeelia commented 5 years ago

Your documentation states:

public function viewAny($user)
{
    return Gate::any(['viewBlog', 'manageBlog'], $user, $post);
}

but you don't pass an argument in the function of $post so it should be

use Illuminate\Support\Facades\Gate;

public function viewAny($user)
{
    return Gate::any(['viewBlog', 'manageBlog'], $user);
}

Also, you will get errors unless you import the Gate Facades.

m2de commented 5 years ago

Hi @joeelia

Thanks, that is indeed an error. Will update the docs.

Cheers.