roles icon indicating copy to clipboard operation
roles copied to clipboard

Find users by group

Open StanBarrows opened this issue 7 years ago • 0 comments

Heyho, Thanks for your package! Is there a way to receive all users by a group?

Something like:

 public function scopeInsideGroup($query, $group = 'default')
  {
      return $query->whereHas('roles', function ($relation_query) use($group) {
          $relation_query->where('group', '=', $group);
      });
  }

Cheers, Stan

StanBarrows avatar Aug 25 '18 10:08 StanBarrows