Reference

$kirby->user()

Returns a specific user by id or the current user if no id is given

$kirby->user(string $id = null, \Kirby\Session\Session|array $session = null): User|null

Parameters

Name Type Default Description
$id string null
$session \Kirby\Session\Session|array null

Session options or session object for getting the current user

Return type

User|null

Source code

kirby/src/Cms/AppUsers.php#L73