Skip to content

Instantly share code, notes, and snippets.

@bericp1
Last active June 8, 2016 17:17
Show Gist options
  • Save bericp1/9d88689f93fc703bbc3d6b08d4ab753b to your computer and use it in GitHub Desktop.
Save bericp1/9d88689f93fc703bbc3d6b08d4ab753b to your computer and use it in GitHub Desktop.
private function allVisibleQuery(array $with = null) {
return $this->model->with(is_null($with) ? $this->with : $with)
->where(function($query) {
return $query->doesntHave('roles', 'or', function($q) {
return $q->whereIn('name', [config('auth.hidden_role'), config('auth.blocked_role')]);
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment