X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/615038ac6d35c6ce25d3553772a042af7b97283a..refs/pull/2734/head:/app/Auth/UserRepo.php diff --git a/app/Auth/UserRepo.php b/app/Auth/UserRepo.php index e437ff1e3..4444c734c 100644 --- a/app/Auth/UserRepo.php +++ b/app/Auth/UserRepo.php @@ -61,6 +61,16 @@ class UserRepo return User::query()->with('roles', 'avatar')->orderBy('name', 'asc')->get(); } + /** + * Get all users as Builder for API + */ + public function getUsersBuilder(int $id = null ) : Builder + { + $query = User::query()->select(['*']) + ->withLastActivityAt() + ->with(['roles', 'avatar']); + return $query; + } /** * Get all the users with their permissions in a paginated format. */