Reference

$user->delete()

Deletes the user

$user->delete(): bool

Return type

bool

Example

try {

  $kirby->user('bastian@example.com')->delete();
  echo 'The user has been deleted';

} catch(Exception $e) {

  echo 'The user could not be deleted';
  // optional reason: echo $e->getMessage();

}

Source code

kirby/src/Cms/UserActions.php#L216