Saikishore's avatar

Role, Permissions attachment issue

Hi Team,

I am having Roles, Permissions with relation "role_permission" pivot table with ManyToMany relation.

I am trying to attach new permission to role from Role View page. But I am not getting permissions in select box. Also getting error as

Trying to get property 'resourceClass' of non-object

in nova/src/Http/Controllers/AttachableController.php

Please check my Fields code in Role Resource.

public function fields(Request $request)
    {
        return [
            ID::make()->sortable(),
            Text::make('Name')->sortable()->rules('required', 'max:255'),
            BelongsToMany::make('permission')
        ];
    }

0 likes
3 replies
crnkovic's avatar

BelongsToMany::make(‘Permissions’, ‘permissions’, Permission::class)

Saikishore's avatar

It looks like it has been fixed in latest version. Please give me some time and If it works I will close this.

Please or to participate in this conversation.