-
Notifications
You must be signed in to change notification settings - Fork 1.5k
How would I do the opposite of ->where('array_field', 'all', ['item']) #2114
-
I have the need to find all users that do not have a certain permission. What I would do when I want to find all users with some permissions is:
$users = User::where('permissions', 'all', ['my permission', 'other permission'])->get();
But if I want to find specific users that do not have the 'admin admin' permission, I have no idea how to do it.
Beta Was this translation helpful? Give feedback.
All reactions
Wow, was it as simple as $users = User::where('permissions','!=, 'admin admin')->get();
or am I missing something, I've wasted more than an hour to try this..
Replies: 1 comment 1 reply
-
Wow, was it as simple as $users = User::where('permissions','!=, 'admin admin')->get();
or am I missing something, I've wasted more than an hour to try this..
Beta Was this translation helpful? Give feedback.
All reactions
-
Yes, it definitely was that simple, in case anyone else is wondering the same.
Beta Was this translation helpful? Give feedback.