TelegramUserInfo
Immutable DTO with user info returned by Telegram Login Widget.
TelegramUserInfo::__construct()
public function __construct(string $id, string $firstName, ?string $lastName = null, ?string $username = null, ?string $photoUrl = null):Parameters
| Name | Type | Description |
|---|---|---|
| $id | string | |
| $firstName | string | |
| $lastName | ?string | |
| $username | ?string | |
| $photoUrl | ?string |
TelegramUserInfo::getFullName()
public function getFullName(): stringJoin first and last name into one display string, trimming when the last name is absent.
TelegramUserInfo::toArray()
public function toArray(): arrayConvert to a plain array using Telegram Login Widget field names (snake_case).