$users
The $users object refers to a collection of users with or without Panel access. Like all collections, you can filter, modify, convert or check the users collection.
- 
    
      
      new Users()
- 
    
      
      $users->add()
- 
    
      
      $users->append()
- 
    
      
      $users->callMethod()
- 
    
      
      $users->chunk()
- 
    
      
      $users->clone()
- 
    
      
      $users->count()
- 
    
      
      $users->create()
- 
    
      
      $users->current()
- 
    
      
      $users->data()
- 
    
      
      $users->empty()
- 
    
      
      $users->extend()
- 
    
      
      Users::factory()
- 
    
      
      $users->filter()
- 
    
      
      $users->filterBy()
- 
    
      
      $users->find()
- 
    
      
      $users->findBy()
- 
    
      
      $users->findByKey()
- 
    
      
      $users->first()
- 
    
      
      $users->flip()
- 
    
      
      $users->get()
- 
    
      
      $users->getAttribute()
- 
    
      
      $users->getIterator()
- 
    
      
      $users->group()
- 
    
      
      $users->groupBy()
- 
    
      
      $users->has()
- 
    
      
      $users->hasMethod()
- 
    
      
      $users->indexOf()
- 
    
      
      $users->intersection()
- 
    
      
      $users->intersects()
- 
    
      
      $users->isEmpty()
- 
    
      
      $users->isEven()
- 
    
      
      $users->isNotEmpty()
- 
    
      
      $users->isOdd()
- 
    
      
      $users->key()
- 
    
      
      $users->keyOf()
- 
    
      
      $users->keys()
- 
    
      
      $users->last()
- 
    
      
      $users->limit()
- 
    
      
      Users::load()
- 
    
      
      $users->map()
- 
    
      
      $users->next()
- 
    
      
      $users->not()
- 
    
      
      $users->nth()
- 
    
      
      $users->offset()
- 
    
      
      $users->paginate()
- 
    
      
      $users->pagination()
- 
    
      
      $users->parent()
- 
    
      
      $users->pluck()
- 
    
      
      $users->prepend()
- 
    
      
      $users->prev()
- 
    
      
      $users->query()
- 
    
      
      $users->random()
- 
    
      
      $users->remove()
- 
    
      
      $users->rewind()
- 
    
      
      $users->role()
- 
    
      
      $users->search()
- 
    
      
      $users->set()
- 
    
      
      $users->shuffle()
- 
    
      
      $users->slice()
- 
    
      
      $users->sort()
- 
    
      
      Users::sortArgs()
- 
    
      
      $users->sortBy()
- 
    
      
      $users->toArray()
- 
    
      
      $users->toJson()
- 
    
      
      $users->toString()
- 
    
      
      $users->valid()
- 
    
      
      $users->values()
- 
    
      
      $users->when()
- 
    
      
      $users->without()
How to get a $users object
The users object is available via the $kirby object:
$users = $kirby->users();This will return a collection of all users of the site.
Examples
With the $users object in place, you can now use all the methods of the class, for example:
Get all admin users
$admins = $users->filterBy('isAdmin');Fetch all values of a user field into an array
$userEmails = $users->pluck('email');This will return an array with all the email adresses of all users.
Sort users
$sorted = $users->sortBy('role');