jeffersongoncalves/laravel-posthog
A Laravel integration for PostHog that makes it easy to send analytics events, identify users, and track feature usage from your PHP application through a simple, configurable package API.
Architecture fit
Integration feasibility
identify/alias helpers, batch endpoint available. A single service could ship this in a day.Technical risk
Key questions
fake/test double so our suite doesn't hit the network?PostHogException cover 207-style partial success?Stack fit
Migration path
AnalyticsClient / FeatureFlags interface (capture, identify, flag check, fallback default) so a future vendor swap or a 1.x breaking change touches one class instead of dozens of call sites.Compatibility
~1.0.0 and treat flag and query signatures as unstable until ~1.2.Sequencing
identify/alias only, in one low-traffic service, behind a kill switch.Maintenance
Support
Scaling
Failure modes
PostHogException carrying the raw API error body is excellent for debugging and risky in logs — scrub payloads and keys before logging.Ramp-up
Recommendation: Adopt for capture now; gate feature flags behind a latency spike and a written fail-open policy; keep HogQL/recordings out of request paths; treat the personal API key as a tier-1 secret.
How can I help you explore Laravel packages today?