Replies: 1 comment
-
Version of package? version of laravel? php? give the complete information, also make a failing test or a minimal application to reproduce the problem |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My
User
model has a relationshipposts
.I want to add a conditional based on the current user's permission.
This works fine. However, the user's roles become incorrect later in the request:
auth()->user()->roles
returns more roles than belongs to the user.Observations:
->can()
in the relation is removed, the issue goes away.unsetRelation("roles")
to the relation after callingcan()
,the issue goes away.
Am I misusing the Laravel or the package? Is this a bug?
Beta Was this translation helpful? Give feedback.
All reactions