- How do I install laravel-amplitude and start sending events?
- Install it with Composer using composer require francescomalatesta/laravel-amplitude, then publish the package config with php artisan vendor:publish and set your Amplitude project API key. After that you call the provided facade from controllers, jobs, or services to dispatch track-style payloads. Because the package is a thin wrapper, there is no extra setup beyond the config file and key.
- Which Laravel and PHP versions does laravel-amplitude support?
- The package was built in the Laravel 5.x era with very low adoption and no visible release cadence, so its composer constraints are likely pinned to old framework and PHP versions. On a modern Laravel 10 or 11 / PHP 8.2+ stack you should expect Composer dependency conflicts. Verify the composer.json constraints against your exact versions before committing to it, and plan to fork if they do not resolve.
- Does laravel-amplitude support queues, batching, or retries?
- No. It is a fire-and-forget client that sends synchronous HTTP calls to Amplitude's event API in the request path, with no event buffering, batching, queue integration, or offline persistence. That means every tracked event can add latency to the user's request and a network failure can silently drop data. If you need reliability, wrap the client behind your own interface and dispatch through a Laravel queue with timeouts, bounded retries, and dead-letter logging.
- Which Amplitude API version and region does this package target?
- The wrapper predates Amplitude's v2 HTTP API and EU data-residency endpoints, so it most likely targets a legacy endpoint and payload shape. Amplitude has since changed request formats and added region-specific hosts, which means a stale wrapper may send to deprecated URLs. Check the source against Amplitude's current API documentation, and if you need EU residency or v2 payloads, patch the endpoint and body in a fork.
- Is laravel-amplitude maintained and safe to use in production?
- It has roughly a dozen stars, a single maintainer, and no visible CI or release cadence, so treat it as effectively unmaintained. It is a small, readable package (around a couple hundred lines), which lowers the audit burden but also means you will own any fixes. For production, pin the version, vendor a fork under your own namespace if needed, and watch Amplitude's API changelog yourself.
- Can I use laravel-amplitude on Laravel 11 with PHP 8.2?
- Probably not without changes. The package's dependency constraints and legacy Amplitude endpoint make Composer conflicts likely on Laravel 11 and PHP 8.2, and even if it installs, the payload shape may no longer match Amplitude's current API. The realistic path is to read the source, port the small client into your own code, and modernize the HTTP call and endpoint. That gives you full control over timeouts, retries, and configuration.
- How do I test laravel-amplitude without hitting Amplitude's API?
- The package ships no visible test suite of its own, so you should write contract tests in your application instead. Use Laravel's HTTP client fakes to assert that the expected outbound request URL, headers, and JSON body are produced for a given event. Define your event taxonomy and required properties as assertions, so payload regressions are caught before they reach Amplitude.
- Does laravel-amplitude handle GDPR consent and PII scrubbing?
- There is no evident consent gating, user-ID policy, or PII scrubbing built in, which is a real gap for GDPR- and CCPA-facing products. You should add your own consent check before dispatching, plus an allowlist that strips or hashes sensitive properties and controls how user IDs and device IDs are set. Keeping that logic in an internal client wrapper makes it auditable and consistent across call sites.
- Will laravel-amplitude work with config caching, Octane, and multi-tenant apps?
- The package reads its API key from a published config file, so php artisan config:cache works as usual, but a cached single key is a problem for multi-tenant deployments that need per-tenant Amplitude projects. In that case set the key at runtime through your own client rather than relying on static config. For Octane and long-running workers, confirm there is no static state leaking between requests, and check that the HTTP call honors timeouts.
- What should I use instead of laravel-amplitude, or how do I keep the option to switch?
- Do not couple product code directly to the vendor facade. Introduce an internal AnalyticsClient interface with a method like track(string $event, array $properties, ?string $userId), bind the package behind it, and call only the interface. That gives you a one-file swap to Amplitude's official SDK, Segment, a self-hosted collector, or PostHog later. With the abstraction and queue in place, the adopt, fork, or replace decision stays reversible.