tourze/wechat-work-external-contact-model
A Laravel/PHP model package for WeChat Work (企业微信) external contacts, providing ready-made Eloquent models and relationships for managing external contact data within your application.
composer require tourze/wechat-work-external-contact-model. There is no service provider, config file, or migration set to publish — this is a data-model package, not a Laravel integration.src/ for the model/entity classes and any enum types. Expect the domain objects for WeChat Work 客户联系: external contacts, follow users (跟进成员), contact ways (联系我), tags, and group-chat-ish payloads. Confirm whether the models extend a tourze/model base class or are plain PHP objects before assuming Eloquent compatibility.externalcontact APIs with your own HTTP client, hydrate the JSON response into these models and persist them locally so you can query contacts by external_userid, follow user, or tag without re-hitting the rate-limited API.ExternalContact::from(...)/hydrate → upsert into your own table (or the package's ORM, if wired) → query. If the package has no persistence layer, treat the models as typed DTOs and own the storage yourself.(corp_id, external_userid). Keep the API client separate from the models so you can retry and rate-limit independently.external_userid is scoped per corp. Put corp_id (or tenant id) on every row and make it part of the unique key; never key on external_userid alone.add_way, follow-user status, and tag types are safer as enum comparisons than raw ints from the API.del_follow_user events.follow_user arrays.0.0.4...0.1.0 compare link. In 0.x, a minor bump is frequently breaking. Diff the two tags before upgrading, pin the exact version, and add a smoke test that hydrates a real API sample.composer.json for a Laravel service provider before assuming otherwise.unionid, custom fields). Log the raw payload next to the hydrated model when debugging "missing data" bugs.unionid is optional and only present under certain corp/binding conditions — never make it required or a primary key.datetime column guess.tourze/model/tourze/orm attributes, registering those attributes or bootstrapping that ORM is a prerequisite. If you only want Eloquent, subclass the model and re-declare fields with your own casts.fromArray method if present to retain raw payloads, and keep custom mapping in your own layer rather than forking the package.raw_payload JSON column on your synced table. It makes API-version drift and hydration regressions obvious and lets you backfill without re-calling WeChat.How can I help you explore Laravel packages today?