segmentio/analytics-php
Official PHP client for Segment's analytics API. Track events, identify users, record page views, group accounts, and alias identities from PHP applications, with batching and error handling, routing data to hundreds of analytics and marketing destinations.
segmentio/analytics-php is a framework-agnostic, official Segment server-side PHP client, not a Laravel-native package. It fits Laravel through Composer, a service provider, config binding, and a thin wrapper/facade. Good fit when Segment is the CDP/event pipeline; weaker fit if the team expects Laravel-native auto-tracking, model observers, or built-in queue integration.composer require segmentio/analytics-php, bind a configured client as a singleton in a Laravel service provider, expose config via environment variables, and wrap calls behind an internal analytics service. Keep domain code decoupled via Laravel events/listeners or queued jobs. Prefer async dispatch for non-critical events; avoid per-request synchronous flush unless latency impact is proven acceptable.How can I help you explore Laravel packages today?