PHPackages                             cachethq/segment - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. cachethq/segment

Abandoned → [alt-three/segment](/?search=alt-three%2Fsegment)ArchivedLibrary[Framework](/categories/framework)

cachethq/segment
================

Segment.com wrapper written for Laravel

2.1.2(10y ago)1517.1k2MITPHPPHP &gt;=5.5.9

Since Feb 9Pushed 10y ago2 watchersCompare

[ Source](https://github.com/GrahamDeprecated/Laravel-Segment)[ Packagist](https://packagist.org/packages/cachethq/segment)[ RSS](/packages/cachethq-segment/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (6)Used By (0)

Laravel Segment
===============

[](#laravel-segment)

Segment.com wrapper for Laravel 5.

**THIS PACKAGE IS NOW DEPRECATED. PLEASE LOOK AT [ALTTHREE/SEGMENT](https://github.com/AltThree/Segment)**

Installation
------------

[](#installation)

Add the following to your `composer.json` file.

```
"require": {
    "cachethq/segment": "~2.1"
}
```

Get the package installed.

```
$ composer update
```

Add the service provider to `app.php`

```
'providers' => [
    // ...
    'CachetHQ\Segment\SegmentServiceProvider',
],
```

If you want to use the Facade, also add the alias:

```
'aliases' => [
    // ...
    'Segment'  => 'CachetHQ\Segment\Facades\Segment',
],
```

Install the configuration file.

```
$ php artisan vendor:publish
```

Update the new configuration file with your `write_key` as provided by [Segment.com](https://segment.com)

Using Laravel Segment
---------------------

[](#using-laravel-segment)

Once you've set your `write_key` value in the configuration, you're ready to go! For the most part you can follow [Segments own instructions](https://segment.com/docs/libraries/php/quickstart) however, you'll want to replace the `Analytics` classname with `Segment` - plus, you don't need to call `class_alias`.

### Identify the user

[](#identify-the-user)

```
Segment::identify([
    "userId" => "12345abcde",
    "traits" => [
        "name"  => "James Brooks",
        "email" => "test@test.com",
    ]
]);
```

### Track actions

[](#track-actions)

```
Segment::track([
    "userId"     => "12345abcde",
    "event"      => "Did something",
    "properties" => [
        "was_awesome" => true,
    ]
]);
```

License
-------

[](#license)

Laravel Segment is licensed under [The MIT License (MIT)](LICENSE).

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 77% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~34 days

Total

5

Last Release

3978d ago

Major Versions

1.0.0 → 2.0.02015-03-21

PHP version history (3 changes)1.0.0PHP &gt;=5.4.7

2.0.0PHP &gt;=5.4

2.1.0PHP &gt;=5.5.9

### Community

Maintainers

![](https://www.gravatar.com/avatar/d95eb26cb8f3919bb5ca3b6d823daeabbf259663778a970349b245c580713c8e?d=identicon)[graham-campbell](/maintainers/graham-campbell)

![](https://www.gravatar.com/avatar/cdc9e2de1632032ee831da93db1060f4b3b6aedf1753bdba10740fa39afe7227?d=identicon)[joecohens](/maintainers/joecohens)

![](https://www.gravatar.com/avatar/9e4934b15ff7d8cffabece955994bed29b31429f4c2e8f13fa0868c753bb1c30?d=identicon)[jbrooksuk](/maintainers/jbrooksuk)

---

Top Contributors

[![jbrooksuk](https://avatars.githubusercontent.com/u/246103?v=4)](https://github.com/jbrooksuk "jbrooksuk (47 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (11 commits)")[![joecohens](https://avatars.githubusercontent.com/u/1803556?v=4)](https://github.com/joecohens "joecohens (2 commits)")[![vinkla](https://avatars.githubusercontent.com/u/499192?v=4)](https://github.com/vinkla "vinkla (1 commits)")

---

Tags

apiframeworklaravelcachetsegmentiosegmentlaravel-segmentsegment.comCachetHQCachet HQ

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cachethq-segment/health.svg)

```
[![Health](https://phpackages.com/badges/cachethq-segment/health.svg)](https://phpackages.com/packages/cachethq-segment)
```

###  Alternatives

[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[lanin/laravel-api-debugger

Easily debug your JSON API.

2311.8M](/packages/lanin-laravel-api-debugger)[lanin/laravel-api-exceptions

All in one solution for exception for JSON REST APIs on Laravel and Lumen.

40102.4k](/packages/lanin-laravel-api-exceptions)[saad/api-debugger

Easily debug your JSON API.

1170.1k](/packages/saad-api-debugger)[evias/nem-php

Composer Package for PHP (Laravel or Pure PHP), Wrapper to use the NEM blockchain REST API and SDK with NIS compatibility.

332.9k](/packages/evias-nem-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
