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.
*/