Replies: 1 comment
-
Not, only one query |
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.
-
Hi,
maybe it's a dumb question but i come from a "low level" framework where everything was very clear about when a db query is made or not.
With laravel i'm kind of lost and wondering if i should be careful how often i call
$user->hasRoles('xxxx')
or$user->hasPermissionTo('xxxx')
.Let's say i'm calling 10x
auth()->user()->hasRoles()
, will this translate to a new query each time because everything is lazy loaded or the current user already have all this roles and permissions loaded up at bootstrap ans i can call the functions as many times as I want ?Thanks
Beta Was this translation helpful? Give feedback.
All reactions