diff --git a/app/Models/User.php b/app/Models/User.php index 1bf800b0..1ea07ecc 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -73,6 +73,17 @@ class User extends Authenticatable implements WebAuthnAuthenticatable 'twofaccounts_count' => 'integer', 'groups_count' => 'integer', ]; + + /** + * Scope a query to only include admin users. + * + * @param \Illuminate\Database\Eloquent\Builder $query + * @return \Illuminate\Database\Eloquent\Builder + */ + public function scopeAdmins($query) + { + return $query->where('is_admin', true); + } /** * Send the password reset notification.