agilasadi
3 months ago
31
3
Nova

Laravel nova access restriction vie Gate does not work

Posted 3 months ago by agilasadi

I tried to restrict access to Nova depending on user role. Although It seems like I did everything according to the documentation, Nova seems to ignore it.

    protected function gate()
    {
        Gate::define('viewNova', function ($user) {
            return in_array($user->role_id, [
                '1'
            ]);
        });
    }

Please sign in or create an account to participate in this conversation.