Open StanBarrows opened 5 years ago
Hey Stan,
I ran into the same error, solution is to use use Silvanite\NovaToolPermissions\Role;
instead of use Silvanite\Brandenburg\Role;
in nova/User.php
Your automatic Import probably used the second one instead of the first one, as stated in the readme.
The solution is referring to the Nova Role
resource instead of you main model:
BelongsToMany::make('Roles', 'roles', \App\Nova\Role::class),
I had no luck with this, since this is what the docs already said to do.
I've got use Silvanite\NovaToolPermissions\Role;
and BelongsToMany::make('Roles', 'roles', Role::class),
and I'm still getting this error. I've tried switching to the Brandenberg class, same issue.
The one major thing I can report is that I am using my own App\User class.
Perhaps use php artisan vendor:publish --provider="Silvanite\NovaToolPermissions\Providers\PackageServiceProvider"
? (see docs)
I've actually followed these step by step, including the publish with the config, etc. Perhaps I will remove everything and try to install again from scratch.
No idea, I removed everything and went through the install again, the same as before and it worked. Best I can think of is that there was a single character off somewhere throwing the whole thing off, because otherwise everything was identical. Thanks!
Hey there,
I've just installed your package on an empty project to play a little around. Once I created a role I receive this error. The error only appears if I add the relation on the UserRessource. Any ideas?
BelongsToMany::make('Roles', 'roles', Role::class),
Set-Up:
Cheers, Stan