- What is geekcodev/max-php-client used for?
- geekcodev/max-php-client is a lightweight, framework-agnostic PHP client for the MAX Messenger Bot API. It helps Laravel and plain PHP applications send messages, handle webhooks, manage chats, and build bots through a typed interface. It is installed with Composer and can be used inside controllers, jobs, listeners, or service classes.
- How do I install geekcodev/max-php-client in a Laravel application?
- Install it with Composer using composer require geekcodev/max-php-client, then confirm the resolved version is an immutable v1.1.8 or newer tag. The package is framework-agnostic, so no database migration or queue change is implied. Check composer.json for the exact PHP and Laravel constraints before upgrading.
- Does geekcodev/max-php-client support Laravel 11, Laravel 12, and PHP 8.4?
- The client is framework-agnostic and the provided evaluation references PHP 8.4, PSR-12, PHPStan max, and a large test suite. It does not document Laravel-specific version constraints in the supplied context, so review composer.json for the authoritative PHP and Laravel requirements. Run your application test suite in a non-production environment before adopting it.
- How do I send a message to MAX Messenger with this PHP client?
- Create the client with your MAX bot credentials, then call the message-sending methods exposed by the package's typed API. Keep bot tokens in environment variables and out of logs. Consult the package API reference for the exact request classes and payload fields for your message type.
- How do I handle MAX Messenger webhooks in Laravel using geekcodev/max-php-client?
- Parse inbound payloads with Update::fromArray() and keep ContactVerifier in the ingestion path to verify signatures and reject tampered payloads. The package has no framework coupling, so you can call it from a Laravel controller, listener, or job. Scrub sensitive vcf_info and phone values before writing webhook payloads to logs or journals.
- What is ContactPhoneExtractor::fromVcf() in geekcodev/max-php-client?
- ContactPhoneExtractor::fromVcf() is an additive utility introduced in v1.1.8 for extracting a phone number from vCard data in the MAX contact pipeline. It is a pure, deterministic parser with no I/O, logging, state, or thrown exceptions. Use it as a fallback when an inbound ContactAttachmentPayload does not include vcfPhone.
- Why is vcfPhone missing from inbound MAX contact webhook payloads?
- The outbound payload carries vcf_phone, but the inbound ContactAttachmentPayload does not, so consumers must compute it from vcf_info. Use the fallback expression $contact->vcfPhone ?? ContactPhoneExtractor::fromVcf((string) $contact->vcfInfo). If you use the phone as a CRM, dedupe, or lead key, canonicalize it at that boundary.
- Is upgrading from v1.1.7 to v1.1.8 backward compatible?
- v1.1.8 is additive: it adds ContactPhoneExtractor and leaves ContactVerifier, DTOs, and existing methods untouched. The main integration change is the new inbound fallback for vcfPhone, plus intentional parser improvements such as folded-line support and case-insensitive TEL matching. Do not reuse v1.1.7; upgrade only to a new immutable v1.1.8+ tag.
- What are the limitations of phone extraction from MAX vCard contacts?
- The extractor does not normalize phone numbers, returns only the first non-empty TEL, and intentionally ignores X-TEL. Only one real Russian Android payload has been confirmed, so non-Russian numbers and other vCard clients need additional validation. Treat the extracted value as raw input and canonicalize it before using it as a key.
- How is geekcodev/max-php-client tested and what should I check before production?
- The release evidence cites PHP 8.4, PSR-12, PHPStan max, 351 tests and 904 assertions, 99.81% line coverage, and a clean composer audit. ContactPhoneExtractor is fully covered, but a live contact event still requires manual verification because it cannot be fully automated. Before production, confirm the Packagist tag, replace custom telFromVcf logic behind a service method, scrub PII from logs, and canary webhook ingestion.