Integration with spatie permissions #1975
Replies: 1 comment
-
I just found the problem. The error was actually between the keyboard and chair. I was casting the permissions to array and that was messing things up.... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I followed the docs and added a module column to the permissions table but I am trying to use the syncPermissions() method when I create and update users. However, I always get the same error, which is:
Call to a member function map() on null
At first I thought the view was not returning the correct format for the permissions, however, I found out the data was not the problem.
I decided to hardcode the functionality I wanted just to make sure I was not the problem, so I did this:
But I still get the same error. I decided to take a look at the vendor folder and set some dd() to find what could be wrong and I found out that inside the HasPermission trait, on the givePermissionTo() method (line 401) it is trying to map over $this->permissions which is in fact null.
Can some help me out please?
Beta Was this translation helpful? Give feedback.
All reactions