Since the setPermissionsAttribute() mutator tries to save the model, it is not possible to create a new role along with permissions using the create method ("Integrity constraint violation: 1062 Duplicate entry"). In my opinion mutators are not meant to communicate with database at all.
This is an example of code that does not work:
Role::create([
'name' => 'Administrator',
'slug' => 'admin',
'permissions' => [
'viewNova',
],
]);
There are at least two solutions. You could resign from saving the model within the mutator or guard "permissions" attribute (disable mass assignment).
Great package btw. Thank you 🏅