Skip to content

Contact Data DTO Reference

The NjoguAmos\Waha\Dto\ContactData represents a contact returned from the WAHA API.

php
use NjoguAmos\Waha\Facades\Contact;
use NjoguAmos\Waha\Dto\ContactData;

$response = Contact::all();
$contacts = $response->dtoOrFail(); // ContactData[]

idstring|null

The contact's WhatsApp ID (chat ID).

php
$contact->id; // "[email protected]"

numberstring|null

The contact's phone number.

php
$contact->number; // "11231231231"

namestring|null

The contact's display name.

php
$contact->name; // "Contact Name"

pushnamestring|null

The contact's push name (username set by the contact).

php
$contact->pushname; // "Pushname"

shortNamestring|null

The contact's short name.

php
$contact->shortName; // "Shortname"

isMebool|null

Whether this contact is the authenticated user.

php
$contact->isMe; // true

isGroupbool|null

Whether this contact is a group.

php
$contact->isGroup; // false

isWAContactbool|null

Whether this contact is a WhatsApp user.

php
$contact->isWAContact; // true

isMyContactbool|null

Whether this contact is in the authenticated user's contact list.

php
$contact->isMyContact; // true

isBlockedbool|null

Whether this contact is blocked.

php
$contact->isBlocked; // false

TIP

All fields are nullable. Some fields may not be present in the API response, in which case they will be null.

Released under the MIT License.