Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Segment Laravel Package

cachethq/segment

Laravel integration for Segment analytics, offering a simple facade and service provider to identify users, track events, and record page views. Add your Segment write key and send customer analytics data from your PHP app with minimal setup.

View on GitHub
Deep Wiki
Context7

[DEPRECATED] Segment.com wrapper for Laravel 5

Frequently asked questions about Segment
Is cachethq/segment still maintained?
No. The package is effectively abandoned and archived, with no security patching, compatibility fixes, or response to Segment API changes. It has very low adoption, including zero dependents, so there is no community maintenance path. Treat it as a reference implementation rather than a dependency.
Does cachethq/segment support Laravel 10, 11, or 12?
No official support exists for modern Laravel versions. This is a 2015-vintage package that typically pins old illuminate/support and PHP 5.4/5.5 constraints plus Guzzle 5 or 6, which conflicts with Laravel 10/11/12, PHP 8.2+, and Guzzle 7. Composer require will usually fail without ignore-platform-reqs or a fork.
How do I install cachethq/segment?
The nominal command is composer require cachethq/segment, but on a current Laravel stack it will likely fail dependency resolution. You would need to relax platform requirements or fork and update constraints, neither of which is recommended for an abandoned analytics wrapper. Reimplementing the small adapter yourself is usually faster and safer.
How do I configure the Segment write key with cachethq/segment?
The package follows old Laravel conventions: publish its config, add your Segment write key and options, then manually register the service provider and facade alias in app/config/app.php. Service provider auto-discovery did not exist in 2015, so modern Laravel apps will not discover it automatically. Config publishing may also use Laravel 4-style config:publish rather than vendor:publish.
Does cachethq/segment support Segment EU or UK data residency endpoints?
There is no evidence of region awareness. A 2015 client likely hardcodes https://api.segment.io/v1/... with no support for workspace-specific or EU data residency hosts. If GDPR or UK data residency applies, this package is a blocker and you should own the HTTP adapter.
Can cachethq/segment queue or batch analytics events?
No. It is a thin synchronous wrapper that forwards identify, track, page, group, and alias calls over HTTP without queue integration, batching, retries, backoff, or idempotency keys. That adds latency to user-facing requests and makes analytics loss invisible unless you add your own queueing and failure handling.
What are good alternatives to cachethq/segment for Laravel?
Use Segment's official segmentio/analytics-php library, or write a small Laravel service and facade around your own Guzzle client. That gives you control over queueing, consent gating, PII scrubbing, region-specific endpoints, and testing. Check that any maintained Laravel-native alternative explicitly supports Laravel 11/12 and PHP 8.2+.
Is cachethq/segment safe to use in production?
Not recommended. It is abandoned, receives no security patches, and pulls in 2015-era transitive dependencies that may carry known CVE exposure. It also typically fails silently and performs blocking HTTP calls on the request path, coupling request success to Segment availability if errors are not swallowed.
Does cachethq/segment handle GDPR consent and PII scrubbing?
No. There is no built-in consent or opt-out handling, event allow-listing, or PII redaction. Under GDPR, CCPA, and Segment tracking-plan discipline, you must implement consent gating and data minimization yourself. That logic belongs in your own analytics boundary, not in an unmaintained facade.
How do I test Segment tracking in Laravel if I use cachethq/segment?
You can mock the facade or fake HTTP calls, but the old service provider and Guzzle constraints make modern test setup awkward. A small owned adapter is easier to test because you can bind an interface, swap a fake implementation, and assert events without real Segment calls. Always ensure tests never send production analytics data.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console