Level 43
BelongsToMany::make(‘Permissions’, ‘permissions’, Permission::class)
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')
];
}
Please or to participate in this conversation.