Open chescos opened 4 years ago
Any update on this?
One possible way:
You could extend the original Resource like following and add the $with
property.
...
use Vyuldashev\NovaPermission\Role as BaseRole;
class Role extends BaseRole
{
...
public static $with = [
'permissions'
];
...
}
If you do so don't forget to define the new resource inside the NovaServiceProvider
like this:
public function tools() :array
{
return [
...
NovaPermissionTool::make()
->roleResource( YourNewRoleResource::class ),
...
];
}
Is it possible to add eager-loading for the resources?